Skip to content

Commit

Permalink
MA-15311 DirectAudioPlayer: fix input file NullPointerException when …
Browse files Browse the repository at this point in the history
…click play button

When click play button, met NullPointerException
in paserWAVheader: read = minputStream.read(head);
The minputStream is opened when threadPlay running.

Add some delay before getDuration(paserWAVheader).

Change-Id: Id347f3167c7dff6f9268708d048e587e61bf1cdc
Signed-off-by: Jindong <[email protected]>
Reviewed-on: http://androidsource.ap.freescale.net/project/9742
Reviewed-by: fang hui <[email protected]>
  • Loading branch information
JDYue committed Aug 13, 2019
1 parent 471e322 commit fa27dc6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public void isPlayOrPause() {
Log.i(TAG, "play click");
initSeekbar();
threadPlay.start();
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
avoid_RedundantClickCrash = true;
imageButton.setImageResource(android.R.drawable.ic_media_pause);
seekbar.setMax(threadPlay.getDuration());
Expand Down

0 comments on commit fa27dc6

Please sign in to comment.