[FFmpeg-cvslog] r17447 - in trunk/libavcodec: aac_ac3_parser.c aac_ac3_parser.h ac3_parser.c
jbr
subversion
Thu Feb 19 01:28:19 CET 2009
Author: jbr
Date: Thu Feb 19 01:28:19 2009
New Revision: 17447
Log:
Allow AC-3 parser to modify codec_id.
Patch by Joakim Plate (elupus A ecce D se).
Modified:
trunk/libavcodec/aac_ac3_parser.c
trunk/libavcodec/aac_ac3_parser.h
trunk/libavcodec/ac3_parser.c
Modified: trunk/libavcodec/aac_ac3_parser.c
==============================================================================
--- trunk/libavcodec/aac_ac3_parser.c Thu Feb 19 01:28:08 2009 (r17446)
+++ trunk/libavcodec/aac_ac3_parser.c Thu Feb 19 01:28:19 2009 (r17447)
@@ -72,6 +72,9 @@ get_next:
/* 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 &&
Modified: trunk/libavcodec/aac_ac3_parser.h
==============================================================================
--- trunk/libavcodec/aac_ac3_parser.h Thu Feb 19 01:28:08 2009 (r17446)
+++ trunk/libavcodec/aac_ac3_parser.h Thu Feb 19 01:28:19 2009 (r17447)
@@ -53,6 +53,7 @@ typedef struct AACAC3ParseContext {
uint64_t state;
int need_next_header;
+ enum CodecID codec_id;
} AACAC3ParseContext;
int ff_aac_ac3_parse(AVCodecParserContext *s1,
Modified: trunk/libavcodec/ac3_parser.c
==============================================================================
--- trunk/libavcodec/ac3_parser.c Thu Feb 19 01:28:08 2009 (r17446)
+++ trunk/libavcodec/ac3_parser.c Thu Feb 19 01:28:19 2009 (r17447)
@@ -175,6 +175,10 @@ static int ac3_sync(uint64_t state, AACA
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);
More information about the ffmpeg-cvslog
mailing list