int64_t layout = av_frame_get_channel_layout(frame);
if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {
int64_t layout = av_frame_get_channel_layout(frame);
if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {