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/mov.c | |
parent | 423375d4f06ae7103e575a31c23e62e3ba440845 (diff) | |
parent | 83548fe894cdb455cc127f754d09905b6d23c173 (diff) | |
download | ffmpeg-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/mov.c')
-rw-r--r-- | libavformat/mov.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index f7dd2502c5..3754346f9e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1166,7 +1166,7 @@ static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom) { if (!c->has_looked_for_mfra && c->use_mfra_for > 0) { c->has_looked_for_mfra = 1; - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { int ret; av_log(c->fc, AV_LOG_VERBOSE, "stream has moof boxes, will look " "for a mfra\n"); @@ -5421,9 +5421,9 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) return err; } if (c->found_moov && c->found_mdat && - ((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete) || + ((!(pb->seekable & AVIO_SEEKABLE_NORMAL) || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete) || start_pos + a.size == avio_size(pb))) { - if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete) + if (!(pb->seekable & AVIO_SEEKABLE_NORMAL) || c->fc->flags & AVFMT_FLAG_IGNIDX || c->fragment_index_complete) c->next_root_atom = start_pos + a.size; c->atom_depth --; return 0; @@ -5935,7 +5935,7 @@ static int mov_read_header(AVFormatContext *s) mov->fc = s; mov->trak_index = -1; /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ - if (pb->seekable) + if (pb->seekable & AVIO_SEEKABLE_NORMAL) atom.size = avio_size(pb); else atom.size = INT64_MAX; @@ -5949,7 +5949,7 @@ static int mov_read_header(AVFormatContext *s) mov_read_close(s); return err; } - } while (pb->seekable && !mov->found_moov && !mov->moov_retry++); + } while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->moov_retry++); if (!mov->found_moov) { av_log(s, AV_LOG_ERROR, "moov atom not found\n"); mov_read_close(s); @@ -5957,7 +5957,7 @@ static int mov_read_header(AVFormatContext *s) } av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb)); - if (pb->seekable) { + if (pb->seekable & AVIO_SEEKABLE_NORMAL) { if (mov->nb_chapter_tracks > 0 && !mov->ignore_chapters) mov_read_chapters(s); for (i = 0; i < s->nb_streams; i++) @@ -6118,8 +6118,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st) AVIndexEntry *current_sample = &avst->index_entries[msc->current_sample]; int64_t dts = av_rescale(current_sample->timestamp, AV_TIME_BASE, msc->time_scale); av_log(s, AV_LOG_TRACE, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts); - if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) || - (s->pb->seekable && + if (!sample || (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && current_sample->pos < sample->pos) || + ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb && ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) || (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) { |