[Ffmpeg-devel] support for hddvd .evo files (mpg ps variant) in ffmpeg
Ian Caulfield
ian.caulfield
Wed Jan 17 11:16:39 CET 2007
On 1/17/07, Michael Niedermayer <michaelni at gmx.at> wrote:
>
> [...]
> > @@ -1539,6 +1578,54 @@
> > header_len -= 10;
> > len -= 10;
> > }
> > + if ((flags & 0x01) == 0x01) { /* PES extension */
>
> if(flags & 0x01) is more readable IMHO
fair enough
[...]
> > + if ((pes_ext & 0x80) == 0x80) { /* PES private data */
> > + if (header_len < 16)
> > + goto redo;
> > + url_fskip(&s->pb, 16);
> > + header_len -= 16;
> > + len -= 16;
> > + }
> > + if ((pes_ext & 0x40) == 0x40) { /* pack header - should be
> zero in PS */
> > + goto redo;
> > + }
> > + if ((pes_ext & 0x20) == 0x20) { /* program packet sequence
> counter */
> > + if (header_len < 2)
> > + goto redo;
> > + url_fskip(&s->pb, 2);
> > + header_len -= 2;
> > + len -= 2;
> > + }
> > + if ((pes_ext & 0x10) == 0x10) { /* P-STD buffer */
> > + if (header_len < 2)
> > + goto redo;
> > + url_fskip(&s->pb, 2);
> > + header_len -= 2;
> > + len -= 2;
> > + }
>
> skip= (pes_ext>>4) & 0xB;
> skip+= skip & 0x9;
> if (header_len < skip)
> goto redo;
> url_fskip(&s->pb, skip);
> header_len -= skip;
> len -= skip;
That's certainly shorter :)
[...]
> > @@ -1553,7 +1640,7 @@
> > goto redo;
> > startcode = get_byte(&s->pb);
> > len--;
> > - if (startcode >= 0x80 && startcode <= 0xbf) {
> > + if (startcode >= 0x80 && startcode <= 0xcf) {
> > /* audio: skip header */
> > if (len < 3)
> > goto redo;
> > @@ -1641,15 +1728,22 @@
> > } else if (startcode >= 0x80 && startcode <= 0x87) {
> > type = CODEC_TYPE_AUDIO;
> > codec_id = CODEC_ID_AC3;
> > - } else if (startcode >= 0x88 && startcode <= 0x9f) {
> > + } else if ((startcode >= 0x88 && startcode <= 0x8f)
> > + || (startcode >= 0x98 && startcode <= 0x9f)) {
>
> and what is 0x90 .. 0x97 ?
The documents I've seen say it's reserved for SDDS - I believe the original
0x9f may have been a typo for 0x8f.
Ian
More information about the ffmpeg-devel
mailing list