aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_ladspa.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-12-15 20:53:13 +0100
committerPaul B Mahol <onemda@gmail.com>2015-12-15 20:53:13 +0100
commit09d84e00bd88f9ce191e1fe189c0a0ba8d70c826 (patch)
tree6123bf40cf193edc8b709c59477c52c7b20e7762 /libavfilter/af_ladspa.c
parent0bdf84b6b0527d30970c5fa555c7bc00a852a3cc (diff)
downloadffmpeg-09d84e00bd88f9ce191e1fe189c0a0ba8d70c826.tar.gz
avfilter/af_ladspa: unbreak Mch -> Nch plugins, where M < N
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_ladspa.c')
-rw-r--r--libavfilter/af_ladspa.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c
index c323d2d5d4..6bc73138cc 100644
--- a/libavfilter/af_ladspa.c
+++ b/libavfilter/af_ladspa.c
@@ -26,6 +26,7 @@
#include <dlfcn.h>
#include <ladspa.h>
+#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
@@ -144,6 +145,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out;
int i, h, p;
+ av_assert0(in->channels == s->nb_inputs);
+
if (!s->nb_outputs ||
(av_frame_is_writable(in) && s->nb_inputs == s->nb_outputs &&
!(s->desc->Properties & LADSPA_PROPERTY_INPLACE_BROKEN))) {
@@ -157,6 +160,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
+ av_assert0(!s->nb_outputs || out->channels == s->nb_outputs);
+
for (h = 0; h < s->nb_handles; h++) {
for (i = 0; i < s->nb_inputs; i++) {
p = s->nb_handles > 1 ? h : i;
@@ -298,6 +303,7 @@ static int config_input(AVFilterLink *inlink)
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
+ LADSPAContext *s = ctx->priv;
int ret;
if (ctx->nb_inputs) {
@@ -305,7 +311,7 @@ static int config_output(AVFilterLink *outlink)
outlink->format = inlink->format;
outlink->sample_rate = inlink->sample_rate;
- if (ctx->nb_inputs == ctx->nb_outputs) {
+ if (s->nb_inputs == s->nb_outputs) {
outlink->channel_layout = inlink->channel_layout;
outlink->channels = inlink->channels;
}
@@ -644,7 +650,7 @@ static int query_formats(AVFilterContext *ctx)
if (s->nb_inputs >= 1) {
AVFilterLink *inlink = ctx->inputs[0];
- int64_t inlayout = FF_COUNT2LAYOUT(s->nb_inputs);
+ uint64_t inlayout = FF_COUNT2LAYOUT(s->nb_inputs);
layouts = NULL;
ret = ff_add_channel_layout(&layouts, inlayout);
@@ -662,7 +668,7 @@ static int query_formats(AVFilterContext *ctx)
}
if (s->nb_outputs >= 1) {
- int64_t outlayout = FF_COUNT2LAYOUT(s->nb_outputs);
+ uint64_t outlayout = FF_COUNT2LAYOUT(s->nb_outputs);
layouts = NULL;
ret = ff_add_channel_layout(&layouts, outlayout);