1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-19 09:57:34 +00:00
mpv/demux
wm4 4544fb0856 demux: fix initial backward demuxing state in some cases
Just "mpv file.mkv --play-direction=backward" did not work, because
backward demuxing from the very end was not implemented. This is another
corner case, because the resume mechanism so far requires a packet
"position" (dts or pos) as reference. Now "EOF" is another possible
reference.

Also, the backstep mechanism could cause streams to find different
playback start positions, basically leading to random playback start
(instead of what you specified with --start). This happens only if
backstep seeks are involved (i.e. no cached data yet), but since this is
usually the case at playback start, it always happened. It was racy too,
because it depended on the order the decoders on other threads requested
new data. The comment below "resume_earlier" has some more blabla.

Some other details are changed.

I'm giving up on the "from_cache" parameter, and don't try to detect the
situation when the demuxer does not seek properly. Instead, always seek
back, hopefully some more.

Instead of trying to adjust the backstep seek target by a random value
of 1.0 seconds. Instead, always rely on the random value provided by the
user via --demuxer-backward-playback-step. If the demuxer should really
get "stuck" and somehow miss the seek target badly, or the user sets the
option value to 0, then the demuxer will not make any progress and just
eat CPU. (Although due to backward seek semantics used for backstep
seeks, even a very small seek step size will work. Just not 0.)

It seems this also fixes backstepping correctly when the initial seek
ended at the last keyframe range. (The explanation above was about the
case when it ends at EOF. These two cases are different. In the former,
you just need to step to the previous keyframe range, which was broken
because it didn't always react correctly to reaching EOF. In the latter,
you need to do a separate search for the last keyframe.)
2019-05-24 01:49:43 +02:00
..
codec_tags.c demux_mkv: simplify avi compat. codec_tags.c GUID lookup 2018-09-14 14:17:32 +02:00
codec_tags.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
cue.c cue: strip quotes and leading whitespace from tags 2018-01-30 14:01:15 +01:00
cue.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
demux_cue.c demux_edl, cue, mkv: slightly nicer file format indication 2019-01-11 15:12:30 +01:00
demux_edl.c demux_edl: fix assertion failure on exit in obscure ytdl cases 2019-01-20 15:46:09 +01:00
demux_lavf.c demux_lavf: also fix cachec seeking with large codec delay 2019-05-22 22:32:31 +02:00
demux_libarchive.c demux: change hack for closing subtitle files early 2018-09-07 23:02:36 +02:00
demux_mf.c demux: return packets directly from demuxer instead of using sh_stream 2018-09-07 15:20:32 +02:00
demux_mkv_timeline.c demux_edl, cue, mkv: slightly nicer file format indication 2019-01-11 15:12:30 +01:00
demux_mkv.c demux, demux_mkv: fix seeking in cache with large codec delay 2019-05-22 22:27:07 +02:00
demux_null.c demux_null: mark as seekable 2018-01-06 14:42:22 -08:00
demux_playlist.c demux: change hack for closing subtitle files early 2018-09-07 23:02:36 +02:00
demux_raw.c demux_raw: fix operation with demuxer cache and backward playback 2019-05-20 02:18:59 +02:00
demux_timeline.c demux_timeline: add heuristic to fix shifted seeks with separate audio 2019-01-11 15:12:30 +01:00
demux.c demux: fix initial backward demuxing state in some cases 2019-05-24 01:49:43 +02:00
demux.h Implement backwards playback 2019-05-19 04:15:01 +02:00
ebml.c demux_mkv: adjust log verbosity levels 2018-04-29 02:21:32 +03:00
ebml.h demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
matroska.h ebml, matroska.h: change license to LGPL 2017-04-21 13:34:10 +02:00
packet.c Implement backwards playback 2019-05-19 04:15:01 +02:00
packet.h Implement backwards playback 2019-05-19 04:15:01 +02:00
stheader.h demux, demux_mkv: fix seeking in cache with large codec delay 2019-05-22 22:27:07 +02:00
timeline.c demux_edl, cue, mkv: slightly nicer file format indication 2019-01-11 15:12:30 +01:00
timeline.h demux_edl, cue, mkv: slightly nicer file format indication 2019-01-11 15:12:30 +01:00