]> git.sesse.net Git - mlt/blobdiff - src/modules/frei0r/frei0r_helper.c
Fix encoding audio distortion for planar codecs (3576437)
[mlt] / src / modules / frei0r / frei0r_helper.c
index bbc08cea18cd574c45b4f1a431db599f97ae1ddd..ca6b6a628f4da00fd02b9a5728d7ac4107ba84ef 100644 (file)
@@ -45,7 +45,7 @@ static void rgba_bgra( uint8_t *src, uint8_t* dst, int width, int height )
        }       
 }
 
-int process_frei0r_item( mlt_service service, double position, mlt_properties prop, mlt_frame this, uint8_t **image, int *width, int *height )
+int process_frei0r_item( mlt_service service, double position, double time, mlt_properties prop, mlt_frame this, uint8_t **image, int *width, int *height )
 {
        int i=0;
        f0r_instance_t ( *f0r_construct ) ( unsigned int , unsigned int ) =  mlt_properties_get_data(  prop , "f0r_construct" ,NULL);
@@ -76,7 +76,7 @@ int process_frei0r_item( mlt_service service, double position, mlt_properties pr
        }
        if ( neu == 0 ){
                inst= f0r_construct(*width,*height);
-               mlt_properties_set_data(  prop  ,  ctorname , inst, sizeof(void*) , f0r_destruct , NULL );;
+               mlt_properties_set_data(  prop  ,  ctorname , inst, sizeof( inst ) , f0r_destruct , NULL );;
        }else{
                inst=mlt_properties_get_data( prop ,  ctorname , NULL );
        }
@@ -143,11 +143,11 @@ int process_frei0r_item( mlt_service service, double position, mlt_properties pr
                }
        }
        if (type==producer_type) {
-               f0r_update (inst, position, NULL, dest );
+               f0r_update (inst, time, NULL, dest );
        } else if (type==filter_type) {
-               f0r_update ( inst, position, source[0], dest );
+               f0r_update ( inst, time, source[0], dest );
        } else if (type==transition_type && f0r_update2 ){
-               f0r_update2 ( inst, position, source[0], source[1], NULL, dest );
+               f0r_update2 ( inst, time, source[0], source[1], NULL, dest );
        }
        if ( not_thread_safe )
                mlt_service_unlock( service );
@@ -155,7 +155,7 @@ int process_frei0r_item( mlt_service service, double position, mlt_properties pr
                rgba_bgra((uint8_t*) dest, (uint8_t*) result, *width, *height);
        }
        *image = (uint8_t*) result;
-       mlt_properties_set_data(MLT_FRAME_PROPERTIES(this), "image", result, video_area * sizeof(uint32_t), mlt_pool_release, NULL);
+       mlt_frame_set_image(this, (uint8_t*) result, video_area * sizeof(uint32_t), mlt_pool_release);
        if (extra)
                mlt_pool_release(extra);