diff options
author | wm4 <wm4@nowhere> | 2017-02-22 10:42:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-22 10:43:35 +0100 |
commit | 992e58248867bacc195e7a3a2a7fff04cf8f097e (patch) | |
tree | dd132103e00a6c842a0bad717c99e60dde8e48ee /player | |
parent | c824a023c4f640dd72d4c5dc1511eb53055d7535 (diff) | |
download | mpv-992e58248867bacc195e7a3a2a7fff04cf8f097e.tar.bz2 mpv-992e58248867bacc195e7a3a2a7fff04cf8f097e.tar.xz |
lavfi: temporary workaround for FFmpeg av_buffersrc_parameters_set() bug
The function ignores AVBufferSrcParameters.channel_layout. Set it
manually using the API.
Diffstat (limited to 'player')
-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) |