Commit 0e78e575 authored by Michael Niedermayer's avatar Michael Niedermayer

swr/auto_matrix: treat a single channel as mono instead of failing

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f8d74cbd
......@@ -106,6 +106,13 @@ static int clean_layout(SwrContext *s, int64_t layout){
if((layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == AV_CH_LAYOUT_STEREO_DOWNMIX)
return AV_CH_LAYOUT_STEREO;
if(layout && layout != AV_CH_FRONT_CENTER && !(layout&(layout-1))) {
char buf[128];
av_get_channel_layout_string(buf, sizeof(buf), -1, layout);
av_log(s, AV_LOG_VERBOSE, "Treating %s as mono\n", buf);
return AV_CH_FRONT_CENTER;
}
return layout;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment