On 20/08/13 16:49, John Stebbins wrote:
> On 08/20/2013 07:10 AM, Martin Storsjö wrote:
>> On Mon, 19 Aug 2013, 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 | 12 +++++++++---
>>> 1 file changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> index 6df84f6..0fc173a 100644
>>> --- a/libavformat/movenc.c
>>> +++ b/libavformat/movenc.c
>>> @@ -82,15 +82,21 @@ static int64_t update_size(AVIOContext *pb, int64_t pos)
>>>     return curpos - pos;
>>> }
>>>
>>> +static int is_co64_required(const MOVTrack *track)
>>> +{
>>> +    if (track->cluster[track->entry - 1].pos + track->data_offset > 
>>> UINT32_MAX)
>>> +        return 1;
>>> +    return 0;
>>> +}
>> I didn't check right now, but does this need a check for entry>0, or are 
>> we positive that it won't ever be called in that case?
> 
> ahh, yes, this could possibly be called with entry == 0 when fragments are 
> enabled.
> update attached.
> 

so in the end we got

track_pos = 0;

if (track->entry > 0)
    trac_pos = track->cluster[track->entry - 1].pos + track->data_offset;


if (FFMAX(pos, track_pos) > UINT32_MAX)
...

I'll bake the patch tonight if you want =)

lu

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to