aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-08-27 13:48:37 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:34 -0300
commit678c1952a90570753eee842851e50d9c8a7b111e (patch)
treef677414cca25f04757f1290a15e566205519ff17
parent1c22a29e1a5b7c75ab79a3aedb370d8d95a90ab4 (diff)
downloadffmpeg-678c1952a90570753eee842851e50d9c8a7b111e.tar.gz
avdevice/lavfi: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavdevice/lavfi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 710ad7c530..fdb93b835f 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -332,9 +332,12 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
st ->sample_aspect_ratio =
par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink);
} else if (par->codec_type == AVMEDIA_TYPE_AUDIO) {
- par->channels = av_buffersink_get_channels(sink);
par->sample_rate = av_buffersink_get_sample_rate(sink);
- par->channel_layout = av_buffersink_get_channel_layout(sink);
+ ret = av_channel_layout_from_mask(&par->ch_layout, av_buffersink_get_channel_layout(sink));
+ if (ret < 0) {
+ par->ch_layout.nb_channels = av_buffersink_get_channels(sink);
+ par->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+ }
par->format = av_buffersink_get_format(sink);
par->codec_id = av_get_pcm_codec(par->format, -1);
if (par->codec_id == AV_CODEC_ID_NONE)