[FFmpeg-devel] [PATCH] mp4 fragments support

Michael Niedermayer michaelni
Fri Mar 21 13:28:43 CET 2008


On Fri, Mar 21, 2008 at 11:28:29AM +0100, Baptiste Coudurier wrote:
> 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.

looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080321/d8e0056c/attachment.pgp>



More information about the ffmpeg-devel mailing list