mpv/demux
wm4 b0cb2977ed demux_lavf: bluray: don't skip stream data when flushing
This code meant to flush demuxer internal buffers by doing a byte seek
to the current position. In theory this shouldn't drop any stream data.
However, if the stream positions mismatch, then avio_seek() (called by
av_seek_frame()) stops being a no-op, and might for example read some
data to skip to the seek target. (This can happen if the distance is
less than SHORT_SEEK_THRESHOLD.)

The positions get out of sync because we drop data at one point (which
is what we _want_ to do). Strictly speaking, the AVIOContext flushing is
done incorrectly, becuase pb->pos points to the start of the buffer, not
the current position. So we have to increment pb->pos by the buffered
amount.

Since there are other weird reasons why the positions might go out of
sync (such as stream_dvd.c dropping buffers itself), and they don't
necessarily need to be in sync in the first place unless AVIOContext has
nothing buffered internally, just use the sledgehammer approach and
correct the position manually.

Also run av_seek_frame() after this. Currently, it shouldn't read
anything, but who knows how that might change with future libavformat
development.

This whole change didn't have any observable effect for me, but I'm
hoping it fixes a reported problem.
2014-09-29 18:06:44 +02:00
..
codec_tags.c audio: remove WAVEFORMATEX from internal demuxer API 2014-09-25 01:56:51 +02:00
codec_tags.h audio: decouple demux and audio decoder/filter sample formats 2014-09-24 22:55:50 +02:00
demux.c demux: allow increasing filepos only 2014-09-03 02:00:18 +02:00
demux.h demux: get rid of old wrapper 2014-09-01 22:12:39 +02:00
demux_cue.c Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
demux_disc.c demux_disc: bluray: potentially fix some aspects of seeking 2014-09-29 18:06:44 +02:00
demux_edl.c
demux_lavf.c demux_lavf: bluray: don't skip stream data when flushing 2014-09-29 18:06:44 +02:00
demux_libass.c demux_libass: change how external ASS subtitles are loaded 2014-03-15 22:17:51 +01:00
demux_mf.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
demux_mkv.c demux_mkv: don't use default_duration for parsed packets 2014-09-26 01:25:48 +02:00
demux_playlist.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
demux_raw.c stream_cdda, demux_raw: always use s16le 2014-09-25 21:32:06 +02:00
demux_subreader.c demux: fix timestamp type for seek calls 2014-07-21 19:29:58 +02:00
demux_tv.c audio: decouple demux and audio decoder/filter sample formats 2014-09-24 22:55:50 +02:00
ebml.c Remove mpbswap.h 2014-09-25 21:32:55 +02:00
ebml.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
matroska.h demux_mkv: add S_DVBSUB 2014-06-17 22:44:27 +02:00
mf.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
mf.h
packet.c demux: gracefully handle packet allocation failures 2014-09-16 18:11:00 +02:00
packet.h demux: always use AVPacket 2014-08-25 00:46:26 +02:00
stheader.h demux_mkv: get rid of MS structs 2014-09-25 02:22:50 +02:00