On Sun, 27 Oct 2013 01:24:57 +0200, Vittorio Giovara 
<[email protected]> wrote:
> ---
>  libavcodec/dcadec.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
> index c80bd81..7b5b4cf 100644
> --- a/libavcodec/dcadec.c
> +++ b/libavcodec/dcadec.c
> @@ -1288,7 +1288,7 @@ static int dca_filter_channels(DCAContext *s, int 
> block_index)
>      }
>  
>      /* Down mixing */
> -    if (s->avctx->request_channels == 2 && s->prim_channels > 2) {
> +    if (s->avctx->request_channel_layout == 2 && s->prim_channels > 2) {
>          dca_downmix(s->samples_chanptr, s->amode, s->downmix_coef, 
> s->channel_order_tab);
>      }
>  
> @@ -1803,8 +1803,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void 
> *data,
>      if (s->amode < 16) {
>          avctx->channel_layout = dca_core_channel_layout[s->amode];
>  
> -        if (s->xch_present && (!avctx->request_channels ||
> -                               avctx->request_channels > num_core_channels + 
> !!s->lfe)) {
> +        if (s->xch_present && (!avctx->request_channel_layout ||
> +                               avctx->request_channel_layout > 
> num_core_channels + !!s->lfe)) {
>              avctx->channel_layout |= AV_CH_BACK_CENTER;
>              if (s->lfe) {
>                  avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
> @@ -1826,7 +1826,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void 
> *data,
>              s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
>              return AVERROR_INVALIDDATA;
>  
> -        if (avctx->request_channels == 2 && s->prim_channels > 2) {
> +        if (avctx->request_channel_layout == 2 && s->prim_channels > 2) {
>              channels = 2;
>              s->output = DCA_STEREO;
>              avctx->channel_layout = AV_CH_LAYOUT_STEREO;
> @@ -1922,9 +1922,10 @@ static av_cold int dca_decode_init(AVCodecContext 
> *avctx)
>      avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
>  
>      /* allow downmixing to stereo */
> -    if (avctx->channels > 0 && avctx->request_channels < avctx->channels &&
> -        avctx->request_channels == 2) {
> -        avctx->channels = avctx->request_channels;
> +    if (avctx->channels > 0 &&
> +        avctx->request_channel_layout < avctx->channels &&
> +        avctx->request_channel_layout == 2) {
> +        avctx->channels = avctx->request_channel_layout;
>      }
>  
>      return 0;
> -- 
> 1.8.4

*stab*

This is simply wrong, you cannot just
s/request_channels/request_channel_layout/. The real solution is a bit more
complicated, which is why nobody did it yet.
Please, do try to investigate the problems you don't understand more
thoroughly.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to