Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59ac0b14 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Handle unknown duration in playMediaSamples test" into mnc-dev

parents 7c9d9440 e796ff91
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -823,6 +823,12 @@ public class CodecTest {
            duration = mMediaPlayer.getDuration();
            // start to play
            mMediaPlayer.start();
            if (duration < 0) {
                Log.w(TAG, filePath + " has unknown duration, waiting until playback completes");
                while (mMediaPlayer.isPlaying()) {
                    SystemClock.sleep(1000);
                }
            } else {
                waittime = duration - mMediaPlayer.getCurrentPosition();
                synchronized(onCompletion){
                    try {
@@ -832,6 +838,7 @@ public class CodecTest {
                        return false;
                    }
                }
            }
            terminateMessageLooper();
        } catch (Exception e) {
            Log.v(TAG, "playMediaSamples:" + e.getMessage());