[FFmpeg-cvslog] r11415 - trunk/libavcodec/ac3dec.c

Justin Ruggles justinruggles
Sat Jan 5 16:27:06 CET 2008


jbr wrote:
> Author: jbr
> Date: Sat Jan  5 16:22:53 2008
> New Revision: 11415
> 
> Log:
> check for request_channels at codec init
> 
> Modified:
>    trunk/libavcodec/ac3dec.c
> 
> Modified: trunk/libavcodec/ac3dec.c
> ==============================================================================
> --- trunk/libavcodec/ac3dec.c	(original)
> +++ trunk/libavcodec/ac3dec.c	Sat Jan  5 16:22:53 2008
> @@ -312,6 +312,13 @@ static int ac3_decode_init(AVCodecContex
>          s->mul_bias = 32767.0f;
>      }
>  
> +    /* allow downmixing to stereo or mono */
> +    if (avctx->channels > 0 && avctx->request_channels > 0 &&
> +            avctx->request_channels < avctx->channels &&
> +            avctx->request_channels <= 2) {
> +        avctx->channels = avctx->request_channels;
> +    }
> +
>      return 0;
>  }

Is it okay to do the same to dca, except it would be if
request_channels == 2 instead of <= 2 since dca doesn't support
downmixing to mono.

-Justin




More information about the ffmpeg-cvslog mailing list