Release Android inflight state at decoder EOS before audio tail
This commit is contained in:
1 parent
7b4dfc062a
commit
9ef18b6324
3 files changed
+15
-2
No files matched your search
@@ -81,7 +81,7 @@ internal class StreamDecodePump<F : StreamDecodePump.Frame>(
|
||||
val render = !next.empty && next.pts >= position - 100000
|
||||
release(next, render); output = null
|
||||
if (!next.empty) { if (render) shown++ else discarded++ }
|
||||
if (next.eos) ended = true
|
||||
if (next.eos) { ended = true; submitted.clear() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,8 @@ class StreamPlayerEngine(private val group: Long, private val source: Long, priv
|
||||
}
|
||||
}
|
||||
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 (pausedAudio && !lateVideo) { track!!.play(); pausedAudio = false }
|
||||
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 }
|
||||
}
|
||||
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)
|
||||
&& playedFrames(System.nanoTime()) >= written) {
|
||||
|
||||
Reference in new issue
Block a user