]> git.sesse.net Git - mlt/commitdiff
Convert panner to use range [0, 1].
authorDan Dennedy <dan@dennedy.org>
Tue, 17 Aug 2010 07:47:13 +0000 (00:47 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 17 Aug 2010 07:47:13 +0000 (00:47 -0700)
Instead of [-1, 1]. This works better with Kdenlive.

src/modules/core/filter_panner.c

index b8e577746503a017299e8c0fa237b2a3e2fce346..6ce55d9c984b1f4d278f8adbf78f189e21a9b6ba 100644 (file)
@@ -225,16 +225,14 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame )
                                double end = mlt_properties_get_double( properties, "end" );
                                mix = start + ( end - start ) * mix;
                        }
-                       else if ( fabs( mlt_properties_get_double( properties, "start" ) ) <= 2.0 )
+                       // Use constant mix level if only start
+                       else if ( mlt_properties_get( properties, "start" ) != NULL )
                        {
-                               // Otherwise, start/constructor is a constant mix level
                        mix = mlt_properties_get_double( properties, "start" );
                        }
-                       // >2 means total crossfade (uses position)
-                       else
-                       {
-                               mix = mix * 2.0 - 1.0;
-                       }
+
+                       // Convert it from [0, 1] to [-1, 1]
+                       mix = mix * 2.0 - 1.0;
                
                        // Finally, set the mix property on the frame
                        mlt_properties_set_double( instance_props, "mix", mix );