Showing the changes to libavdevice (1 of 1 file). Show all
Unified · Split
| @@ -332,9 +332,12 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) · 331 unmodified lines | ||
| 332 | 332 | st ->sample_aspect_ratio = |
| 333 | 333 | par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink); |
| 334 | 334 | } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { |
| 335 | − par->channels = av_buffersink_get_channels(sink); | |
| 336 | 335 | par->sample_rate = av_buffersink_get_sample_rate(sink); |
| 337 | − par->channel_layout = av_buffersink_get_channel_layout(sink); | |
| 336 | + ret = av_channel_layout_from_mask(&par->ch_layout, av_buffersink_get_channel_layout(sink)); | |
| 337 | + if (ret < 0) { | |
| 338 | + par->ch_layout.nb_channels = av_buffersink_get_channels(sink); | |
| 339 | + par->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; | |
| 340 | + } | |
| 338 | 341 | par->format = av_buffersink_get_format(sink); |
| 339 | 342 | par->codec_id = av_get_pcm_codec(par->format, -1); |
| 340 | 343 | if (par->codec_id == AV_CODEC_ID_NONE) |