diff options
author | James Almer <jamrial@gmail.com> | 2017-03-21 17:02:30 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-03-21 17:02:30 -0300 |
commit | 4de591e6fb7361bd417dcd9563672ed0ad8b361b (patch) | |
tree | ff6b5c51a4891b49f61d53b88bdfb27cc6a89579 /libavformat/avienc.c | |
parent | 423375d4f06ae7103e575a31c23e62e3ba440845 (diff) | |
parent | 83548fe894cdb455cc127f754d09905b6d23c173 (diff) | |
download | ffmpeg-streaming-4de591e6fb7361bd417dcd9563672ed0ad8b361b.zip ffmpeg-streaming-4de591e6fb7361bd417dcd9563672ed0ad8b361b.tar.gz |
Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'
* commit '83548fe894cdb455cc127f754d09905b6d23c173':
lavf: fix usage of AVIOContext.seekable
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r-- | libavformat/avienc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 4b042a9..91b8c40 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -332,7 +332,7 @@ static int avi_write_header(AVFormatContext *s) avio_wl32(pb, 0); avio_wl32(pb, bitrate / 8); /* XXX: not quite exact */ avio_wl32(pb, 0); /* padding */ - if (!pb->seekable) + if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */ else avio_wl32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */ @@ -414,7 +414,7 @@ static int avi_write_header(AVFormatContext *s) avio_wl32(pb, 0); /* start */ /* remember this offset to fill later */ avist->frames_hdr_strm = avio_tell(pb); - if (!pb->seekable) + if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) /* FIXME: this may be broken, but who cares */ avio_wl32(pb, AVI_MAX_RIFF_SIZE); else @@ -493,7 +493,7 @@ static int avi_write_header(AVFormatContext *s) } } - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { write_odml_master(s, i); } @@ -534,7 +534,7 @@ static int avi_write_header(AVFormatContext *s) ff_end_tag(pb, list2); } - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { /* AVI could become an OpenDML one, if it grows beyond 2Gb range */ avi->odml_list = ff_start_tag(pb, "JUNK"); ffio_wfourcc(pb, "odml"); @@ -611,7 +611,7 @@ static int avi_write_ix(AVFormatContext *s) char ix_tag[] = "ix00"; int i, j; - av_assert0(pb->seekable); + av_assert0(pb->seekable & AVIO_SEEKABLE_NORMAL); for (i = 0; i < s->nb_streams; i++) { AVIStream *avist = s->streams[i]->priv_data; @@ -669,7 +669,7 @@ static int avi_write_idx1(AVFormatContext *s) int i; char tag[5]; - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { AVIStream *avist; AVIIentry *ie = 0, *tie; int empty, stream_id = -1; @@ -783,7 +783,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) av_assert0(par->bits_per_coded_sample >= 0 && par->bits_per_coded_sample <= 8); - if (pb->seekable && avist->pal_offset) { + if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && avist->pal_offset) { int64_t cur_offset = avio_tell(pb); avio_seek(pb, avist->pal_offset, SEEK_SET); for (i = 0; i < pal_size; i++) { @@ -798,7 +798,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) unsigned char tag[5]; avi_stream2fourcc(tag, stream_index, par->codec_type); tag[2] = 'p'; tag[3] = 'c'; - if (s->pb->seekable) { + if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { if (avist->strh_flags_offset) { int64_t cur_offset = avio_tell(pb); avio_seek(pb, avist->strh_flags_offset, SEEK_SET); @@ -854,7 +854,7 @@ static int avi_write_packet_internal(AVFormatContext *s, AVPacket *pkt) avist->packet_count++; // Make sure to put an OpenDML chunk when the file size exceeds the limits - if (pb->seekable && + if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && (avio_tell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) { avi_write_ix(s); ff_end_tag(pb, avi->movi_list); @@ -872,7 +872,7 @@ static int avi_write_packet_internal(AVFormatContext *s, AVPacket *pkt) if (par->codec_type == AVMEDIA_TYPE_AUDIO) avist->audio_strm_length += size; - if (s->pb->seekable) { + if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { int ret; ret = avi_add_ientry(s, stream_index, NULL, flags, size); if (ret < 0) @@ -901,7 +901,7 @@ static int avi_write_trailer(AVFormatContext *s) write_skip_frames(s, i, avist->last_dts); } - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { if (avi->riff_id == 1) { ff_end_tag(pb, avi->movi_list); res = avi_write_idx1(s); @@ -950,7 +950,7 @@ static int avi_write_trailer(AVFormatContext *s) av_freep(&avist->indexes.cluster[j]); av_freep(&avist->indexes.cluster); avist->indexes.ents_allocated = avist->indexes.entry = 0; - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { avio_seek(pb, avist->frames_hdr_strm + 4, SEEK_SET); avio_wl32(pb, avist->max_size); } |