diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-23 02:33:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-23 04:31:55 +0100 |
commit | e99f1a8cc8b90926209b7390ae3f50d519c0e63f (patch) | |
tree | b50f42ffe92fdb5fb2bc1efeaf9625d208e9c6ca /libavformat/mov.c | |
parent | 094673ff1b1a0f83584f3aeea76a3e9c9e3129bf (diff) | |
parent | 562ebc30775db243941db3c96396e7bf8a0e0a44 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
dxva2: don't check for DXVA_PictureParameters->wDecodedPictureIndex
img2: split muxer and demuxer into separate files
rm: prevent infinite loops for index parsing.
aac: fix infinite loop on end-of-frame with sequence of 1-bits.
mov: Add more HDV and XDCAM FourCCs.
lavf: don't set AVCodecContext.has_b_frames in compute_pkt_fields().
rmdec: when using INT4 deinterleaving, error out if sub_packet_h <= 1.
cdxl: correctly synchronize video timestamps to audio
mlpdec_parser: fix a few channel layouts.
Add channel names to channel_names[] array for channels added in b2890f5
movenc: Buffer the mdat for the initial moov fragment, too
flvdec: Ignore the index if the ignidx flag is set
flvdec: Fix indentation
movdec: Don't parse all fragments if ignidx is set
movdec: Restart parsing root-level atoms at the right spot
prores: use natural integer type for the codebook index
mov: Add support for MPEG2 HDV 720p24 (hdv4)
swscale: K&R formatting cosmetics (part I)
swscale: variable declaration and placement cosmetics
Conflicts:
configure
libavcodec/aacdec.c
libavcodec/mlp_parser.c
libavformat/flvdec.c
libavformat/img2.c
libavformat/isom.h
libavformat/mov.c
libavformat/movenc.c
libswscale/rgb2rgb.c
libswscale/rgb2rgb_template.c
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 7d9248db59..ff97a9b58f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -353,8 +353,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (err < 0) return err; if (c->found_moov && c->found_mdat && - (!pb->seekable || start_pos + a.size == avio_size(pb))) + ((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) || + start_pos + a.size == avio_size(pb))) { + if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) + c->next_root_atom = start_pos + a.size; return 0; + } left = a.size - avio_tell(pb) + start_pos; if (left > 0) /* skip garbage at atom end */ avio_skip(pb, left); @@ -2821,8 +2825,11 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) sample = mov_find_next_sample(s, &st); if (!sample) { mov->found_mdat = 0; - if (s->pb->seekable|| - mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 || + if (!mov->next_root_atom) + return AVERROR_EOF; + avio_seek(s->pb, mov->next_root_atom, SEEK_SET); + mov->next_root_atom = 0; + if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 || url_feof(s->pb)) return AVERROR_EOF; av_dlog(s, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb)); |