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/asfenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/asfenc.c') diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index dc1dd73364..a40c02d00d 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -433,7 +433,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, avio_wl64(pb, play_duration); /* end time stamp (in 100ns units) */ avio_wl64(pb, send_duration); /* duration (in 100ns units) */ avio_wl64(pb, PREROLL_TIME); /* start time stamp */ - avio_wl32(pb, (asf->is_streamed || !pb->seekable) ? 3 : 2); /* ??? */ + avio_wl32(pb, (asf->is_streamed || !(pb->seekable & AVIO_SEEKABLE_NORMAL)) ? 3 : 2); /* ??? */ avio_wl32(pb, s->packet_size); /* packet size */ avio_wl32(pb, s->packet_size); /* packet size */ avio_wl32(pb, bit_rate); /* Nominal data rate in bps */ @@ -954,7 +954,7 @@ static int asf_write_trailer(AVFormatContext *s) asf_write_index(s, asf->index_ptr, asf->maximum_packet, asf->nb_index_count); avio_flush(s->pb); - if (asf->is_streamed || !s->pb->seekable) { + if (asf->is_streamed || !(s->pb->seekable & AVIO_SEEKABLE_NORMAL)) { put_chunk(s, 0x4524, 0, 0); /* end of stream */ } else { /* rewrite an updated header */ -- cgit v1.2.3