0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
mpv/demux
wm4 d41f0a54b0 player: improve instant track switching
When switching tracks, we normally have the problem that data gets lost
due to readahead buffering. (Which in turn is because we're stubborn and
instruct the demuxers to discard data on unselected streams.) The
demuxer layer has a hack that re-reads discarded buffered data if a
stream is enabled mid-stream, so track switching will seem instant.

A somewhat similar problem is when all tracks of an external files were
disabled - when enabling the first track, we have to seek to the target
position.

Handle these with the same mechanism. Pass the "current time" to the
demuxer's stream switch function, and let the demuxer figure out what to
do. The demuxer will issue a refresh seek (if possible) to update the
new stream, or will issue a "normal" seek if there was no active stream
yet.

One case that changes is when a video/audio stream is enabled on an
external file with only a subtitle stream active, and the demuxer does
not support rrefresh seeks. This is a fuzzy case, because subtitles are
sparse, and the demuxer might have skipped large amounts of data. We
used to seek (and send the subtitle decoder some subtitle packets
twice). This case is sort of obscure and insane, and the fix would be
questionable, so we simply don't care.

Should mostly fix #3392.
2016-08-06 15:47:04 +02:00
..
codec_tags.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01: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 Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +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 Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
demux_disc.c player: improve instant track switching 2016-08-06 15:47:04 +02:00
demux_edl.c demux_edl: adjust warnings and variable names 2016-05-23 15:23:27 +02:00
demux_lavf.c demux_lavf: remove subtitle seeking special-case 2016-07-24 18:41:55 +02:00
demux_libarchive.c libarchive: unify entry iteration between stream/demux layers 2016-07-18 12:44:56 +02:00
demux_mf.c demux: remove relative seeking 2016-02-28 19:28:34 +01:00
demux_mkv_timeline.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
demux_mkv.c demux_mkv: support Matroska webvtt 2016-06-14 16:43:07 +02:00
demux_null.c demux_null: fix segfault with --cache enabled 2016-03-05 00:56:55 +01:00
demux_playlist.c demux_playlist: recognize m3u8 as playlist extension 2016-05-17 18:18:00 +02:00
demux_rar.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
demux_raw.c audio: use --audio-channels=auto behavior, except on ALSA 2016-08-04 20:49:20 +02:00
demux_timeline.c player: improve instant track switching 2016-08-06 15:47:04 +02:00
demux_tv.c demux: merge sh_video/sh_audio/sh_sub 2016-01-12 23:48:19 +01:00
demux.c player: improve instant track switching 2016-08-06 15:47:04 +02:00
demux.h player: improve instant track switching 2016-08-06 15:47:04 +02:00
ebml.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
ebml.h Update license headers 2015-04-13 12:10:01 +02:00
matroska.h demux_mkv: remove indirection through defines 2015-06-19 21:41:57 +02:00
packet.c Rewrite ordered chapters and timeline stuff 2016-02-15 21:04:07 +01:00
packet.h Rewrite ordered chapters and timeline stuff 2016-02-15 21:04:07 +01:00
stheader.h demux_lavf, ad_lavc, ad_spdif, vd_lavc: handle FFmpeg codecpar API change 2016-03-31 22:00:45 +02:00
timeline.c demux: timeline: honor quit requests 2015-02-20 22:08:02 +01:00
timeline.h demux: timeline: honor quit requests 2015-02-20 22:08:02 +01:00