summaryrefslogtreecommitdiff
path: root/libavformat/rmenc.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/rmenc.c
parent8d1267932ca9c2e343ef303349101bab6681d02e (diff)
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/rmenc.c')
-rw-r--r--libavformat/rmenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 59118c9484..6cbe700219 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -123,7 +123,7 @@ static int rv10_write_header(AVFormatContext *ctx,
avio_wb32(s, 0); /* data offset : will be patched after */
avio_wb16(s, ctx->nb_streams); /* num streams */
flags = 1 | 2; /* save allowed & perfect play */
- if (!s->seekable)
+ if (!(s->seekable & AVIO_SEEKABLE_NORMAL))
flags |= 4; /* live broadcast */
avio_wb16(s, flags);
@@ -175,7 +175,7 @@ static int rv10_write_header(AVFormatContext *ctx,
avio_wb32(s, 0); /* start time */
avio_wb32(s, BUFFER_DURATION); /* preroll */
/* duration */
- if (!s->seekable || !stream->total_frames)
+ if (!(s->seekable & AVIO_SEEKABLE_NORMAL) || !stream->total_frames)
avio_wb32(s, (int)(3600 * 1000));
else
avio_wb32(s, (int)(stream->total_frames * 1000 / stream->frame_rate));
@@ -433,7 +433,7 @@ static int rm_write_trailer(AVFormatContext *s)
int data_size, index_pos, i;
AVIOContext *pb = s->pb;
- if (s->pb->seekable) {
+ if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
/* end of file: finish to write header */
index_pos = avio_tell(pb);
data_size = index_pos - rm->data_pos;