1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

If AVCodecContext.channels is 0 and AVCodecContext.channel_layout is

non-zero, set channels based on channel_layout.

This allows the user to set only channel_layout and not channels.
This commit is contained in:
Justin Ruggles 2011-04-19 19:03:47 -04:00
parent 168f9e8c40
commit 688b09fa59

View File

@ -584,6 +584,8 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
ret = AVERROR(EINVAL);
goto free_and_end;
}
} else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
}
}