[FFmpeg-devel] [PATCH] mp4 fragments support

Baptiste Coudurier baptiste.coudurier
Fri Mar 21 11:28:29 CET 2008


Hi Michael,

Michael Niedermayer wrote:
> On Thu, Mar 20, 2008 at 08:00:46PM +0100, Baptiste Coudurier wrote:
>> Hi,
>>
>> Here is the patch to support mp4 fragments.
>> The patch is shorter than I thought.
>>
>> If stream is streamable, all fragments are parsed when reading header,
> 
>> if not atoms are read when no more samples are left.
> 
> this part could be commited seperately

Ok. I will. I removed the mov_read_packet hunk.

>> keyframe flag is already brainded because all samples on mplayerhq.hu
>> seems to have this particular symptom, though flags 0 should not mean
>> keyframe.
>>
>> Comments ?
> [...]
>> +    frag->track_id = get_be32(pb);
>> +    if (!frag->track_id || frag->track_id > c->fc->nb_streams)
>> +        return -1;
> 
> Maybe it would be safer to check this before its stored in
> c->fragment->track_id instead of afterwards.

Done.

> [...]
>> +    if (c->trex_count > UINT_MAX / sizeof(*c->trex_data))
>> +        return -1;
>> +    c->trex_data = av_realloc(c->trex_data, (c->trex_count+1)*sizeof(*c->trex_data));
> 
> c->trex_count = UINT_MAX / sizeof(*c->trex_data)
> 
> (UINT_MAX / sizeof(*c->trex_data) + 1)*sizeof(*c->trex_data)
> UINT_MAX / sizeof(*c->trex_data)*sizeof(*c->trex_data) + sizeof(*c->trex_data)

Yes, thanks.

Update attached.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG SAS                                     http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp4_fragments2.patch
Type: text/x-diff
Size: 8402 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080321/927a64ce/attachment.patch>



More information about the ffmpeg-devel mailing list