]> git.sesse.net Git - mlt/commitdiff
Fix channel alignment in sox filter.
authorDan Dennedy <dan@dennedy.org>
Fri, 3 Sep 2010 18:37:52 +0000 (11:37 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 3 Sep 2010 18:37:52 +0000 (11:37 -0700)
This pointer swapping is somehow breaking the stereo imaging even though
I can not see why now. Anyways, it no longer support multiple effects,
so it does not matter.

src/modules/sox/filter_sox.c

index f4bb5593819994a91dc5a2a5a6b0f22e2d3576fa..9dfe1bd5d16792c58cabee6b426ae89a90bbb280 100644 (file)
@@ -21,6 +21,7 @@
 #include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 #include <framework/mlt_tokeniser.h>
+#include <framework/mlt_log.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -337,15 +338,12 @@ static int filter_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *f
                                        
                                        // Apply the effect
 #ifdef SOX14
-                                       if ( ( * e->handler.flow )( e, input_buffer, output_buffer, &isamp, &osamp ) == ST_SUCCESS )
+                                       if ( ( * e->handler.flow )( e, input_buffer, output_buffer, &isamp, &osamp ) != ST_SUCCESS )
 #else
-                                       if ( ( * e->h->flow )( e, input_buffer, output_buffer, &isamp, &osamp ) == ST_SUCCESS )
+                                       if ( ( * e->h->flow )( e, input_buffer, output_buffer, &isamp, &osamp ) != ST_SUCCESS )
 #endif
                                        {
-                                               // Swap input and output buffer pointers for subsequent effects
-                                               p = input_buffer;
-                                               input_buffer = output_buffer;
-                                               output_buffer = p;
+                                               mlt_log_warning( MLT_FILTER_SERVICE(filter), "effect processing failed\n" );
                                        }
                                        
                                        // XXX: hack to restore the original vol gain to prevent accumulation
@@ -362,7 +360,7 @@ static int filter_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *f
                        }
 
                        // Write back
-                       memcpy( output_buffer, input_buffer, *samples * sizeof(st_sample_t) );
+                       memcpy( input_buffer, output_buffer, *samples * sizeof(st_sample_t) );
                }
        }