mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-01-12 00:06:51 +08:00
avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio format, such as: ffplay -f lavfi anullsrc=cl=2C,aformat=s16 Without the patch, "Channel layout change is not supported" errors are generated because buffersrc (unknown 2 channel) and buffersink (stereo) negotiated a stereo layout, but the stereo layout was never stored in the BufferSourceContext. This fixes a regression of7251f90972, but this is more of a regression of the avfilter channel layout conversion (1f96db959c). Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit2df2b4067e)
This commit is contained in:
@@ -446,7 +446,7 @@ static int config_props(AVFilterLink *link)
|
||||
}
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
if (!c->ch_layout.nb_channels) {
|
||||
if (!c->ch_layout.nb_channels || c->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) {
|
||||
int ret = av_channel_layout_copy(&c->ch_layout, &link->ch_layout);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user