[FFmpeg-cvslog] lavr: call mix_function_init() in ff_audio_mix_set_matrix()

Justin Ruggles git at videolan.org
Tue Feb 5 16:33:00 CET 2013


ffmpeg | branch: release/1.1 | Justin Ruggles <justin.ruggles at gmail.com> | Wed Jan 16 14:15:57 2013 -0500| [d7e7e12abc7e7451aad94225c25c679edc71378c] | committer: Reinhard Tartler

lavr: call mix_function_init() in ff_audio_mix_set_matrix()

This is needed if a custom matrix is set by the user after opening the
AVAudioResampleContext because the matrix channel count can change if
different mixing coefficients are used.

CC:libav-stable at libav.org
(cherry picked from commit f07ef2d9c9e9d1e84c532e9102594834e88a5c83)

Conflicts:

	libavresample/audio_mix.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7e7e12abc7e7451aad94225c25c679edc71378c
---

 libavresample/audio_mix.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c
index 2b3d9f1..c056028 100644
--- a/libavresample/audio_mix.c
+++ b/libavresample/audio_mix.c
@@ -401,10 +401,6 @@ AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr)
         av_free(matrix_dbl);
     }
 
-    ret = mix_function_init(am);
-    if (ret < 0)
-        goto error;
-
     return am;
 
 error:
@@ -544,8 +540,5 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
         return AVERROR(EINVAL);
     }
 
-    /* TODO: detect situations where we can just swap around pointers
-             instead of doing matrix multiplications with 0.0 and 1.0 */
-
-    return 0;
+    return mix_function_init(am);
 }



More information about the ffmpeg-cvslog mailing list