1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 06:30:06 +00:00
mpv/player
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
..
lua ytdl: Error out with http_dash_segments 2016-07-30 19:02:39 +02:00
audio.c audio: use --audio-channels=auto behavior, except on ALSA 2016-08-04 20:49:20 +02:00
client.c build: silence -Wunused-result 2016-06-07 14:12:33 +02:00
client.h global: add client API pointer to library handle 2016-01-15 22:54:08 +01:00
command.c audio: refactor mixer code and delete mixer.c 2016-07-17 19:21:28 +02:00
command.h player: rewrite deinterlace filter auto-insertion 2016-07-05 21:10:26 +02:00
configfiles.c audio: drop --softvol=no and --softvol=auto 2016-07-09 18:31:18 +02:00
core.h player: offset demuxer on start/seek properly with audio/sub delay 2016-08-04 11:26:57 +02:00
external_files.c ta: remove old and redundant macro 2016-05-17 10:53:14 +02:00
external_files.h
lavfi.c lavfi: shut up false positive compiler warnings 2016-04-26 19:38:51 +02:00
lavfi.h player: add complex filter graph support 2016-02-05 23:19:56 +01:00
loadfile.c player: improve instant track switching 2016-08-06 15:47:04 +02:00
lua.c osd: cleanup: make OSDTYPE_ constants private to OSD code 2016-03-08 22:01:57 +01:00
main.c audio: use --audio-channels=auto behavior, except on ALSA 2016-08-04 20:49:20 +02:00
misc.c player: offset demuxer on start/seek properly with audio/sub delay 2016-08-04 11:26:57 +02:00
osd.c player: do not cut off terminal status line if it contains newlines 2016-07-15 18:58:36 +02:00
playloop.c player: offset demuxer on start/seek properly with audio/sub delay 2016-08-04 11:26:57 +02:00
screenshot.c video: refactor how VO exports hwdec device handles 2016-05-09 20:03:22 +02:00
screenshot.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
scripting.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
sub.c osd: cleanup: make OSDTYPE_ constants private to OSD code 2016-03-08 22:01:57 +01:00
video.c player: disable DS with spdif transcoding too 2016-07-24 19:19:24 +02:00