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:
parent
168f9e8c40
commit
688b09fa59
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user