From 83548fe894cdb455cc127f754d09905b6d23c173 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 27 Sep 2016 16:26:37 +0200 Subject: lavf: fix usage of AVIOContext.seekable It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL. --- libavformat/avidec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/avidec.c') diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 3666b573e0..ddc7c2b6f4 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -761,7 +761,8 @@ static int avi_read_header(AVFormatContext *s) break; case MKTAG('i', 'n', 'd', 'x'): pos = avio_tell(pb); - if (pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) && + if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && + !(s->flags & AVFMT_FLAG_IGNIDX) && read_braindead_odml_indx(s, 0) < 0 && (s->error_recognition & AV_EF_EXPLODE)) goto fail; @@ -828,7 +829,7 @@ fail: return AVERROR_INVALIDDATA; } - if (!avi->index_loaded && pb->seekable) + if (!avi->index_loaded && (pb->seekable & AVIO_SEEKABLE_NORMAL)) avi_load_index(s); avi->index_loaded = 1; -- cgit v1.2.3