diff options
author | Jan Ekström <jeebjp@gmail.com> | 2022-05-24 23:11:39 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2022-06-15 21:19:10 +0300 |
commit | 0411acf5f632fd5814a9f62760df4d21fafc1b89 (patch) | |
tree | e71854c9014e67f087e0e17b25d5b214fe3ba5d9 | |
parent | edfd17ab1863ffdc512df4427f3203aeabe4dd0f (diff) | |
download | mpv-0411acf5f632fd5814a9f62760df4d21fafc1b89.tar.bz2 mpv-0411acf5f632fd5814a9f62760df4d21fafc1b89.tar.xz |
f_lavfi: switch to AVChannelLayout when available
-rw-r--r-- | filters/f_lavfi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c index e764598997..ec6fb9f095 100644 --- a/filters/f_lavfi.c +++ b/filters/f_lavfi.c @@ -33,6 +33,8 @@ #include <libavfilter/buffersink.h> #include <libavfilter/buffersrc.h> +#include "config.h" + #include "common/common.h" #include "common/av_common.h" #include "common/tags.h" @@ -40,6 +42,7 @@ #include "audio/format.h" #include "audio/aframe.h" +#include "audio/chmap_avchannel.h" #include "video/mp_image.h" #include "audio/fmt-conversion.h" #include "video/fmt-conversion.h" @@ -470,7 +473,11 @@ static bool init_pads(struct lavfi *c) params->sample_rate = mp_aframe_get_rate(fmt); struct mp_chmap chmap = {0}; mp_aframe_get_chmap(fmt, &chmap); +#if !HAVE_AV_CHANNEL_LAYOUT params->channel_layout = mp_chmap_to_lavc(&chmap); +#else + mp_chmap_to_av_layout(¶ms->ch_layout, &chmap); +#endif pad->timebase = (AVRational){1, mp_aframe_get_rate(fmt)}; filter_name = "abuffer"; } else if (pad->type == MP_FRAME_VIDEO) { |