]> git.sesse.net Git - mlt/blobdiff - src/modules/core/filter_data_show.c
Print useful information for xml parse errors and warnings.
[mlt] / src / modules / core / filter_data_show.c
index 45946caae3cf80b77cd0b1c999756e33c40f2d6e..73d7d778f243fcc6c599be29da3e8258de637955 100644 (file)
@@ -21,6 +21,7 @@
 #include <framework/mlt.h>
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 
 /** Handle the profile.
 */
@@ -209,6 +210,14 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame
                                                                        strcat( result, tc );
                                                                        free( tc );
                                                                }
+                                                               else if ( !strcmp( keywords, "frame" ) )
+                                                               {
+                                                                       // special case: replace #frame# with current frame number
+                                                                       int pos = mlt_properties_get_int( feed, "position" );
+                                                                       char s[12];
+                                                                       snprintf( s, sizeof(s) - 1, "%d", pos );
+                                                                       strcat( result, s );
+                                                               }
                                                                else
                                                                {
                                                                        // replace keyword with metadata value
@@ -291,12 +300,16 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
        // Get the frame properties
        mlt_properties frame_properties = MLT_FRAME_PROPERTIES( frame );
 
+       mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
        // Track specific
        process_queue( mlt_properties_get_data( frame_properties, "data_queue", NULL ), frame, filter );
 
        // Global
        process_queue( mlt_properties_get_data( frame_properties, "global_queue", NULL ), frame, filter );
 
+       mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
        // Need to get the image
        return mlt_frame_get_image( frame, image, format, width, height, 1 );
 }