diff options
author | Vladimir Pantelic <vladoman@gmail.com> | 2011-05-17 17:30:05 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-05-17 22:06:00 +0200 |
commit | 69fa23961ededd725c68b188493cf2653d70f4fd (patch) | |
tree | 17ad6ac5e80e3a18d3848d890c48ec81c30edb2e /libavformat/utils.c | |
parent | b58bc17cf72fcd79b6ed80faae2d0c88729def15 (diff) | |
download | ffmpeg-69fa23961ededd725c68b188493cf2653d70f4fd.tar.gz |
asfdec: do not fall back to binary/generic search
asf_read_seek() inside the asf demuxer already does the
right thing, it tries the index and if that fails it uses
binary search. If binary search is called from outside of asfdec.c
it will fail because the asf code cannot clean up after itself.
Therefore introduce AVFMT_NOBINSEARCH that prevents the seek
code to fallback to binary search and AVFMT_NOGENSEARCH that
prevents the seek code to fallback to generic search.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 67aa76ad75..ad226016aa 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1713,10 +1713,12 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f return 0; } - if(s->iformat->read_timestamp) + if(s->iformat->read_timestamp && !(s->iformat->flags & AVFMT_NOBINSEARCH)) return av_seek_frame_binary(s, stream_index, timestamp, flags); - else + else if (!(s->iformat->flags & AVFMT_NOGENSEARCH)) return av_seek_frame_generic(s, stream_index, timestamp, flags); + else + return -1; } int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) |