[FFmpeg-devel] [PATCH] OGG/Dirac demuxing

Peter Ross pross
Mon Jan 26 03:54:56 CET 2009


On Mon, Jan 26, 2009 at 01:32:33AM +0000, M?ns Rullg?rd wrote:
> Peter Ross <pross at xvid.org> writes:
> 
> > Patch enclosed for our favorite file format.
> >
> > +static uint64_t
> > +dirac_gptopts(AVFormatContext *ctx, int idx, uint64_t gp)
> > +{
> > +    return gp >> 22;
> > +}
> 
> It's not that simple.  Not by far.

Disagree. The Dirac encapsulation specification removes much of the complexity
you are hinting at:

 1. the upper 32-bits of the 'granule_position' field indicates the picture
      number (display-ordered).
 2. no more than one picture encapsulated per 'ogg packet'
 3. one 'ogg packet' should be terminated per 'ogg page'
 4. 'ogg packets' should not continue/span over pages.

Yes, points 3 & 4 are shoulds, not shalls. So it is conceivable that somebody
may create an OGG/Dirac file with multiple packets per page. IMHO, such an
edge case is not evening worth thinking about, unless somebody supplies an
.ogg file demonstrating this behaviour.

Nb: the >>22 above is incorrect, >>32 was intended.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- 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/20090126/bea469dd/attachment.pgp>



More information about the ffmpeg-devel mailing list