# HG changeset patch # User jbr # Date 1235003299 0 # Node ID 82ab0b77695b56ead53db4286f71d240afd73bf1 # Parent e7d87561b42b356fb4e3673a9239f1bb078d5653 Allow AC-3 parser to modify codec_id. Patch by Joakim Plate (elupus A ecce D se). diff -r e7d87561b42b -r 82ab0b77695b aac_ac3_parser.c --- a/aac_ac3_parser.c Thu Feb 19 00:28:08 2009 +0000 +++ b/aac_ac3_parser.c Thu Feb 19 00:28:19 2009 +0000 @@ -72,6 +72,9 @@ /* update codec info */ avctx->sample_rate = s->sample_rate; + if(s->codec_id) + avctx->codec_id = s->codec_id; + /* allow downmixing to stereo (or mono for AC-3) */ if(avctx->request_channels > 0 && avctx->request_channels < s->channels && diff -r e7d87561b42b -r 82ab0b77695b aac_ac3_parser.h --- a/aac_ac3_parser.h Thu Feb 19 00:28:08 2009 +0000 +++ b/aac_ac3_parser.h Thu Feb 19 00:28:19 2009 +0000 @@ -53,6 +53,7 @@ uint64_t state; int need_next_header; + enum CodecID codec_id; } AACAC3ParseContext; int ff_aac_ac3_parse(AVCodecParserContext *s1, diff -r e7d87561b42b -r 82ab0b77695b ac3_parser.c --- a/ac3_parser.c Thu Feb 19 00:28:08 2009 +0000 +++ b/ac3_parser.c Thu Feb 19 00:28:19 2009 +0000 @@ -175,6 +175,10 @@ hdr_info->bit_rate = hdr.bit_rate; hdr_info->channels = hdr.channels; hdr_info->samples = AC3_FRAME_SIZE; + if(hdr.bitstream_id>10) + hdr_info->codec_id = CODEC_ID_EAC3; + else + hdr_info->codec_id = CODEC_ID_AC3; *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT); *new_frame_start = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT);