summaryrefslogtreecommitdiffstats
path: root/DOCS/man
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-25 15:40:22 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitf24ff0e9484bc0b38cdcd7137c7b41195620439b (patch)
tree76c56791c5eae8afe1c6572f8f5d04d59a87bf35 /DOCS/man
parenta84c4de31f32dd46aa5b57b072ee32b913f5d80a (diff)
downloadmpv-f24ff0e9484bc0b38cdcd7137c7b41195620439b.tar.bz2
mpv-f24ff0e9484bc0b38cdcd7137c7b41195620439b.tar.xz
demux: add an explicit start state for backward demuxing
Yay, more subtle state on top of this nightmarish, fragile state machine. But this is what happens when you subvert the laws of nature. This simple checks where playback should "resume" from when no packets were returned to the decoder yet after the seek that initiated backward playback. The main purpose is to process the first returned keyframe range in the same way like all other ranges. This ensures that things like preroll are included properly. Before this commit, it could for example have happened that the start of the first audio frame was slightly broken, because no preroll was included. Since the audio frame is reversed before sending it to the audio output, it would have added an audible discontinuity before the second frame was played; all subsequent frames would have been fine. (Although I didn't test and confirm this particular issue.) In future, this could be useful for certain other things. At least the condition for delaying the backstep seek becomes simpler and more explicit. Move the code that attempts to start demuxing up in dequeue_packet. Before, it was not called when the stream was in back_restarting state. This commit makes streams be in back_restarting state at initialization, so the demuxer would never have started reading. Likewise, we need to call back_demux_see_packets() right after seek in case the seek was within the cache. (We don't bother with checking whether it was a cached seek; nothing happens if it was a normal one.) There is nothing else that would process these cached packets explicitly, although coincidences could sporadically trigger it. The check for back_restart_next in find_backward_restart_pos() now decides whether to use this EOF special code. Since the backward playback start state also sets this variable, we don't need some of the complex checks in dequeue_packet() anymore either.
Diffstat (limited to 'DOCS/man')
0 files changed, 0 insertions, 0 deletions