|
|
|
@ -263,7 +263,8 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (playbackStarted && playback != 0L && ready >= 0) { |
|
|
|
if (playbackStarted && playback != 0L && ready >= 0) { |
|
|
|
val lateVideo = video.firstOutputPts == null || (video.oldestSubmittedPts >= 0 && video.oldestSubmittedPts < position - 10000) |
|
|
|
val lateVideo = !video.ended && (video.firstOutputPts == null |
|
|
|
|
|
|
|
|| (video.oldestSubmittedPts >= 0 && video.oldestSubmittedPts < position - 10000)) |
|
|
|
if (lateVideo && track != null && !pausedAudio) { track!!.pause(); pausedAudio = true } |
|
|
|
if (lateVideo && track != null && !pausedAudio) { track!!.pause(); pausedAudio = true } |
|
|
|
if (pausedAudio && !lateVideo) { track!!.play(); pausedAudio = false } |
|
|
|
if (pausedAudio && !lateVideo) { track!!.play(); pausedAudio = false } |
|
|
|
val head = playedFrames(System.nanoTime()) |
|
|
|
val head = playedFrames(System.nanoTime()) |
|
|
|
@ -282,6 +283,7 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv |
|
|
|
MediaCodec.BUFFER_FLAG_END_OF_STREAM); eosQueued = true } |
|
|
|
MediaCodec.BUFFER_FLAG_END_OF_STREAM); eosQueued = true } |
|
|
|
} |
|
|
|
} |
|
|
|
video.step(position, System.nanoTime() / 1000); video.checkProgress(System.nanoTime() / 1000, ended) |
|
|
|
video.step(position, System.nanoTime() / 1000); video.checkProgress(System.nanoTime() / 1000, ended) |
|
|
|
|
|
|
|
check(!video.ended || video.firstOutputPts != null || video.inputCount == 0L) { "Decoder ended without producing an image" } |
|
|
|
} |
|
|
|
} |
|
|
|
if (ended && video.input == null && (decoder == null || video.ended) && NativeLib.streamPlaybackEmpty(playback) |
|
|
|
if (ended && video.input == null && (decoder == null || video.ended) && NativeLib.streamPlaybackEmpty(playback) |
|
|
|
&& playedFrames(System.nanoTime()) >= written) { |
|
|
|
&& playedFrames(System.nanoTime()) >= written) { |
|
|
|
|