aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-09-27 16:26:37 +0200
committerAnton Khirnov <anton@khirnov.net>2016-09-30 16:54:33 +0200
commit83548fe894cdb455cc127f754d09905b6d23c173 (patch)
tree87d466a0d6b205a99ee046e44ab155a8e082f28c /libavformat/asfdec.c
parent8d1267932ca9c2e343ef303349101bab6681d02e (diff)
downloadffmpeg-83548fe894cdb455cc127f754d09905b6d23c173.tar.gz
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.
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 7d71789029..1c50ad627c 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -960,7 +960,7 @@ static int asf_read_data(AVFormatContext *s, const GUIDParseTable *g)
size, asf->nb_packets);
avio_skip(pb, 2); // skip reserved field
asf->first_packet_offset = avio_tell(pb);
- if (pb->seekable && !(asf->b_flags & ASF_FLAG_BROADCAST))
+ if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !(asf->b_flags & ASF_FLAG_BROADCAST))
align_position(pb, asf->offset, asf->data_size);
return 0;
@@ -1738,7 +1738,9 @@ static int asf_read_header(AVFormatContext *s)
size = avio_rl64(pb);
align_position(pb, asf->offset, size);
}
- if (asf->data_reached && (!pb->seekable || (asf->b_flags & ASF_FLAG_BROADCAST)))
+ if (asf->data_reached &&
+ (!(pb->seekable & AVIO_SEEKABLE_NORMAL) ||
+ (asf->b_flags & ASF_FLAG_BROADCAST)))
break;
}
@@ -1747,7 +1749,7 @@ static int asf_read_header(AVFormatContext *s)
ret = AVERROR_INVALIDDATA;
goto failed;
}
- if (pb->seekable)
+ if (pb->seekable & AVIO_SEEKABLE_NORMAL)
avio_seek(pb, asf->first_packet_offset, SEEK_SET);
for (i = 0; i < asf->nb_streams; i++) {