[FFmpeg-cvslog] r12570 - in trunk/libavcodec: aac_ac3_parser.h aac_parser.c ac3.h ac3_parser.c ac3_parser.h ac3dec.c

Justin Ruggles justinruggles
Mon Mar 24 23:02:52 CET 2008


bwolowiec wrote:
> Modified: trunk/libavcodec/aac_parser.c
> ==============================================================================
> --- trunk/libavcodec/aac_parser.c	(original)
> +++ trunk/libavcodec/aac_parser.c	Mon Mar 24 22:25:49 2008
> @@ -83,6 +83,7 @@ static int aac_sync(AACAC3ParseContext *
>  static av_cold int aac_parse_init(AVCodecParserContext *s1)
>  {
>      AACAC3ParseContext *s = s1->priv_data;
> +    s->stream_type = 0;
>      s->inbuf_ptr = s->inbuf;
>      s->header_size = AAC_HEADER_SIZE;
>      s->sync = aac_sync;
...
> Modified: trunk/libavcodec/ac3_parser.c
> ==============================================================================
> --- trunk/libavcodec/ac3_parser.c	(original)
> +++ trunk/libavcodec/ac3_parser.c	Mon Mar 24 22:25:49 2008
> @@ -84,10 +84,14 @@ int ff_ac3_parse_header(const uint8_t bu
>          hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
>          hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
>          hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
> +        hdr->stream_type = 0;
>      } else {
>          /* Enhanced AC-3 */
>          hdr->crc1 = 0;
> -        skip_bits(&gbc, 2); // skip stream type
> +        hdr->stream_type = get_bits(&gbc, 2);
> +        if(hdr->stream_type == 3)
> +            return AC3_PARSE_ERROR_STREAM_TYPE;
> +

This was my fault for not noticing before, but you actually need to
*use* the enum for stream type as well.
for example:

if(hdr->stream_type == EAC3_STREAM_TYPE_RESERVED)
    return AC3_PARSE_ERROR_STREAM_TYPE;

Thanks,
Justin




More information about the ffmpeg-cvslog mailing list