[FFmpeg-devel] [PATCH]Fix MLP in AOB, v2

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 9 14:18:36 CEST 2012


On Mon, Mar 26, 2012 at 11:27:47PM +0200, Carl-Eugen Hoyos wrote:
> @@ -503,6 +504,8 @@ static int mpegps_read_packet(AVFormatContext *s,
>          type = AVMEDIA_TYPE_AUDIO;
>          /* 16 bit form will be handled as CODEC_ID_PCM_S16BE */
>          codec_id = CODEC_ID_PCM_DVD;
> +        if (startcode == 0xa1)
> +            codec_id = CODEC_ID_MLP;

How sure are you this is correct?
0xA1 should simply be the second PCM stream.
Also, it seems to me this would not allow for more than one MLP stream
per AOB.

> @@ -548,7 +551,10 @@ static int mpegps_read_packet(AVFormatContext *s,
>   found:
>      if(st->discard >= AVDISCARD_ALL)
>          goto skip;
> -    if ((startcode >= 0xa0 && startcode <= 0xaf) ||
> +    if (startcode == 0xa1 && len > header_length) {
> +        avio_skip(s->pb, header_length);
> +        len -= header_length;
> +    } else if ((startcode >= 0xa0 && startcode <= 0xaf) ||

I don't think it makes sense to go into the else case if len <=
header_length...


More information about the ffmpeg-devel mailing list