diff options
author | wm4 <wm4@nowhere> | 2015-03-03 12:34:27 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-03 12:36:08 +0100 |
commit | 22d11d7b3a4f82128245ed5e0b7dfc91755ad188 (patch) | |
tree | f6c398886b29f499e9523324af6846f8ccfcc28a /demux/demux_lavf.c | |
parent | 97940e0f48796a5079deff860120ffe4715be722 (diff) | |
download | mpv-22d11d7b3a4f82128245ed5e0b7dfc91755ad188.tar.bz2 mpv-22d11d7b3a4f82128245ed5e0b7dfc91755ad188.tar.xz |
Revert "demux_lavf: workaround for broken libavformat subtitle seeking"
This reverts commit c8f49be919ffaf983bde77b63d75f96a593ec7a8.
Not needed anymore; fixed in all supported FFmpeg releases. Though I
could not test again, because all sample files are gone (oops).
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 90f49f40f9..4c960403da 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -920,31 +920,12 @@ static void demux_seek_lavf(demuxer_t *demuxer, double rel_seek_secs, int flags) // API by default, because there are some major issues. // Set max_ts==ts, so that demuxing starts from an earlier position in // the worst case. - // To make this horrible situation even worse, some lavf demuxers have - // broken timebase handling (everything that uses - // ff_subtitles_queue_seek()), and always uses the stream timebase. So - // we use the timebase and stream index of the first enabled stream - // (i.e. a stream which can participate in seeking). - int stream_index = -1; - AVRational time_base = {1, AV_TIME_BASE}; - for (int n = 0; n < priv->num_streams; n++) { - struct sh_stream *stream = priv->streams[n]; - AVStream *st = priv->avfc->streams[n]; - if (stream && st->discard != AVDISCARD_ALL) { - stream_index = n; - time_base = st->time_base; - break; - } - } - int64_t pts = priv->last_pts; - if (pts != AV_NOPTS_VALUE) - pts = pts / (double)AV_TIME_BASE * av_q2d(av_inv_q(time_base)); - int r = avformat_seek_file(priv->avfc, stream_index, INT64_MIN, - pts, pts, avsflags); + int r = avformat_seek_file(priv->avfc, -1, INT64_MIN, + priv->last_pts, priv->last_pts, avsflags); // Similar issue as in the normal seeking codepath. if (r < 0) { - avformat_seek_file(priv->avfc, stream_index, INT64_MIN, - pts, INT64_MAX, avsflags); + avformat_seek_file(priv->avfc, -1, INT64_MIN, + priv->last_pts, INT64_MAX, avsflags); } } } |