diff options
-rw-r--r-- | player/lavfi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/player/lavfi.c b/player/lavfi.c index 2573a92833..5183b0e690 100644 --- a/player/lavfi.c +++ b/player/lavfi.c @@ -28,6 +28,7 @@ #include <libavutil/mathematics.h> #include <libavutil/rational.h> #include <libavutil/error.h> +#include <libavutil/opt.h> #include <libavfilter/avfilter.h> #include <libavfilter/buffersink.h> #include <libavfilter/buffersrc.h> @@ -444,6 +445,14 @@ static bool init_pads(struct lavfi *c) goto error; } + if (pad->type == STREAM_AUDIO) { + char layout[80]; + snprintf(layout, sizeof(layout), "%lld", + (long long)params->channel_layout); + av_opt_set(pad->buffer, "channel_layout", layout, + AV_OPT_SEARCH_CHILDREN); + } + int ret = av_buffersrc_parameters_set(pad->buffer, params); av_free(params); if (ret < 0) |