On 08/19/2013 12:18 PM, Luca Barbato wrote: > On 19/08/13 20:49, John Stebbins wrote: >> From: Clément Bœsch <[email protected]> >> >> The old method doesn't work when moov is relocated to beginning of file >> --- >> libavformat/movenc.c | 16 +++++++++++++--- >> 1 file changed, 13 insertions(+), 3 deletions(-) >> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c >> index c7536f5..e6adb58 100644 >> --- a/libavformat/movenc.c >> +++ b/libavformat/movenc.c >> @@ -83,15 +83,25 @@ static int64_t update_size(AVIOContext *pb, int64_t pos) >> return curpos - pos; >> } >> >> +static int is_co64_required(const MOVTrack *track) >> +{ >> + int i; >> + >> + for (i = 0; i < track->entry; i++) { >> + if (track->cluster[i].pos + track->data_offset > UINT32_MAX) >> + return 1; >> + } >> + return 0; >> +} > A saner approach would be keeping the value in the track and act > accordingly. > >
Do you mean add a field to MOVTrack that flags the need for 64 bit offsets and then update this field whenever a packet is written? If this is what you mean, then there are additional places where code to update this field would have to be added (mov_flush_fragment and compute_moov_size where data_offset is updated).Having this logic in one place seemed simpler. -- John GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01 83F0 49F1 D7B2 60D4 D0F7
signature.asc
Description: OpenPGP digital signature
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
