]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_extrastereo.c
Merge commit 'e4cdef00263dc8b3c8de9d34ceacd00dc68979c0'
[ffmpeg] / libavfilter / af_extrastereo.c
index a746006f7107feb1712b56a6f8c98ff29bba8e8e..13c6f4777679e90502ab5665ad32d7251bcdfbfb 100644 (file)
@@ -71,7 +71,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     if (av_frame_is_writable(in)) {
         out = in;
     } else {
-        out = ff_get_audio_buffer(inlink, in->nb_samples);
+        out = ff_get_audio_buffer(outlink, in->nb_samples);
         if (!out) {
             av_frame_free(&in);
             return AVERROR(ENOMEM);
@@ -90,9 +90,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         right   = average + mult * (right - average);
 
         if (s->clip) {
-            dst[n * 2    ] = av_clipf(left,  -1, 1);
-            dst[n * 2 + 1] = av_clipf(right, -1, 1);
+            left  = av_clipf(left,  -1, 1);
+            right = av_clipf(right, -1, 1);
         }
+
+        dst[n * 2    ] = left;
+        dst[n * 2 + 1] = right;
     }
 
     if (out != in)