# HG changeset patch # User reimar # Date 1187900908 0 # Node ID 1a92e129a679d4eef9997ae881b9af36604c06c1 # Parent a6f5ed0503351386272e7803ea489e37ceb24374 Add request_channels member to AVCodecContext so we now have a proper way to tell the decoder how many output channels we would like. diff -r a6f5ed050335 -r 1a92e129a679 avcodec.h --- a/avcodec.h Thu Aug 23 10:49:14 2007 +0000 +++ b/avcodec.h Thu Aug 23 20:28:28 2007 +0000 @@ -33,8 +33,8 @@ #define AV_STRINGIFY(s) AV_TOSTRING(s) #define AV_TOSTRING(s) #s -#define LIBAVCODEC_VERSION_INT ((51<<16)+(41<<8)+0) -#define LIBAVCODEC_VERSION 51.41.0 +#define LIBAVCODEC_VERSION_INT ((51<<16)+(42<<8)+0) +#define LIBAVCODEC_VERSION 51.42.0 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) @@ -2123,6 +2123,13 @@ * - decoding: unused */ int64_t timecode_frame_start; + + /** + * Decoder should decode to this many channels if it can (0 for default) + * - encoding: unused + * - decoding: Set by user. + */ + int request_channels; } AVCodecContext; /** diff -r a6f5ed050335 -r 1a92e129a679 dca.c --- a/dca.c Thu Aug 23 10:49:14 2007 +0000 +++ b/dca.c Thu Aug 23 20:28:28 2007 +0000 @@ -1158,6 +1158,7 @@ avctx->bit_rate = s->bit_rate; channels = s->prim_channels + !!s->lfe; + avctx->channels = avctx->request_channels; if(avctx->channels == 0) { avctx->channels = channels; } else if(channels < avctx->channels) { diff -r a6f5ed050335 -r 1a92e129a679 utils.c --- a/utils.c Thu Aug 23 10:49:14 2007 +0000 +++ b/utils.c Thu Aug 23 20:28:28 2007 +0000 @@ -753,6 +753,7 @@ {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E}, {"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_DROP_FRAME_TIMECODE, INT_MIN, INT_MAX, V|E, "flags2"}, {"non_linear_q", "use non linear quantizer", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_NON_LINEAR_QUANT, INT_MIN, INT_MAX, V|E, "flags2"}, +{"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D}, {NULL}, };