diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-22 14:16:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-22 14:16:52 +0200 |
commit | 25e4ec6aa14d5e9f2aebc87e1f076c4669f2e1f7 (patch) | |
tree | bc72f44369a2f248ed136aad95d9d40ee8f085b8 | |
parent | 606a30c5a11522130658e0807b340ce922a390a6 (diff) | |
parent | 60198742ff851f11a3757c713fc75a9c19b88566 (diff) | |
download | ffmpeg-25e4ec6aa14d5e9f2aebc87e1f076c4669f2e1f7.tar.gz |
Merge commit '60198742ff851f11a3757c713fc75a9c19b88566'
* commit '60198742ff851f11a3757c713fc75a9c19b88566':
movenc: fix detection of 64bit offset requirement
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/movenc.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index b31338858d..13ffa24c2c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -93,16 +93,10 @@ static int supports_edts(MOVMuxContext *mov) return (mov->use_editlist<0 && !(mov->flags & FF_MOV_FLAG_FRAGMENT)) || mov->use_editlist>0; } -static int is_co64_required(const MOVTrack *track) +static int co64_required(const MOVTrack *track) { - int i; - - for (i = 0; i < track->entry; i++) { - if (!track->cluster[i].chunkNum) - continue; - if (track->cluster[i].pos + track->data_offset > UINT32_MAX) - return 1; - } + if (track->entry > 0 && track->cluster[track->entry - 1].pos + track->data_offset > UINT32_MAX) + return 1; return 0; } @@ -110,7 +104,7 @@ static int is_co64_required(const MOVTrack *track) static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track) { int i; - int mode64 = is_co64_required(track); // use 32 bit size variant if possible + int mode64 = co64_required(track); // use 32 bit size variant if possible int64_t pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ if (mode64) |