]> git.sesse.net Git - mlt/blobdiff - src/modules/swfdec/producer_swfdec.c
Fix crash in glDeleteSync() called on wrong thread.
[mlt] / src / modules / swfdec / producer_swfdec.c
index 8f0d7008b4b45baebc20e1f0b1dd2c1d6f31a553..83640fbf4ff8b812a352b4b3ddb1fa8937aeff34 100644 (file)
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
+#include <limits.h>
 
 typedef struct
 {
@@ -112,7 +113,6 @@ static int get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *forma
        producer_swfdec swfdec = mlt_frame_pop_service( frame );
        mlt_service service = MLT_PRODUCER_SERVICE( &swfdec->parent );
        mlt_profile profile = mlt_service_profile( service );
-       mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
 
        mlt_service_lock( service );
        
@@ -125,10 +125,10 @@ static int get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *forma
        *format = mlt_image_rgb24a;
 
        *buffer = mlt_pool_alloc( *width * ( *height + 1 ) * 4 );
-       mlt_properties_set_data( properties, "image", *buffer, *width * ( *height + 1 ) * 4, (mlt_destructor) mlt_pool_release, NULL );
+       mlt_frame_set_image( frame, *buffer, *width * ( *height + 1 ) * 4, mlt_pool_release );
 
        // Seek
-       mlt_position pos = mlt_properties_get_position( properties, "swfdec.position" );
+       mlt_position pos = mlt_frame_original_position( frame );
        if ( pos > swfdec->last_position )
        {
                gulong msec = 1000UL * ( pos - swfdec->last_position ) * profile->frame_rate_den / profile->frame_rate_num;
@@ -179,11 +179,8 @@ static int get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
        mlt_properties_set_int( properties, "test_image", 0 );
        mlt_properties_set_int( properties, "width", swfdec->width );
        mlt_properties_set_int( properties, "height", swfdec->height );
-       mlt_properties_set_int( properties, "real_width", swfdec->width );
-       mlt_properties_set_int( properties, "real_height", swfdec->height );
        mlt_properties_set_int( properties, "progressive", 1 );
        mlt_properties_set_double( properties, "aspect_ratio", 1.0 );
-       mlt_properties_set_position( properties, "swfdec.position", mlt_producer_frame( producer ) );
 
        // Push the get_image method on to the stack
        mlt_frame_push_service( *frame, swfdec );
@@ -270,8 +267,16 @@ mlt_producer producer_swfdec_init( mlt_profile profile, mlt_service_type type, c
        return producer;
 }
 
+static mlt_properties metadata( mlt_service_type type, const char *id, void *data )
+{
+       char file[ PATH_MAX ];
+       snprintf( file, PATH_MAX, "%s/swfdec/%s", mlt_environment( "MLT_DATA" ), (char*) data );
+       return mlt_properties_parse_yaml( file );
+}
+
 MLT_REPOSITORY
 {
        swfdec_init();
        MLT_REGISTER( producer_type, "swfdec", producer_swfdec_init );
+       MLT_REGISTER_METADATA( producer_type, "swfdec", metadata, "producer_swfdec.yml" );
 }