]> git.sesse.net Git - mlt/blobdiff - src/modules/xml/consumer_xml.c
Make xml consumer respect video_off and audio_off.
[mlt] / src / modules / xml / consumer_xml.c
index 8f4735315e56f295de4e562d31971aae752754f8..77226db00eb6390676d0259ff35a383853eb33e2 100644 (file)
@@ -234,7 +234,7 @@ static void serialise_properties( serialise_context context, mlt_properties prop
                         strcmp( name, "width" ) &&
                         strcmp( name, "height" ) )
                {
-                       char *value;
+                       char *value = NULL;
                        if ( !strcmp( name, "length" ) )
                        {
                                char *time = mlt_properties_get_time( properties, name, context->time_format );
@@ -665,6 +665,8 @@ static void serialise_service( serialise_context context, mlt_service service, x
                        else
                        {
                                serialise_producer( context, service, node );
+                               if ( mlt_properties_get( properties, "xml" ) != NULL )
+                                       break;
                        }
                }
 
@@ -918,6 +920,9 @@ static void *consumer_thread( void *arg )
        // Frame and size
        mlt_frame frame = NULL;
 
+       int video_off = mlt_properties_get_int( properties, "video_off" );
+       int audio_off = mlt_properties_get_int( properties, "audio_off" );
+
        // Loop while running
        while( !terminated && mlt_properties_get_int( properties, "running" ) )
        {
@@ -939,8 +944,10 @@ static void *consumer_thread( void *arg )
                        mlt_audio_format aformat = mlt_audio_s16;
                        uint8_t *buffer;
 
-                       mlt_frame_get_image( frame, &buffer, &iformat, &width, &height, 0 );
-                       mlt_frame_get_audio( frame, (void**) &buffer, &aformat, &frequency, &channels, &samples );
+                       if ( !video_off )
+                               mlt_frame_get_image( frame, &buffer, &iformat, &width, &height, 0 );
+                       if ( !audio_off )
+                               mlt_frame_get_audio( frame, (void**) &buffer, &aformat, &frequency, &channels, &samples );
 
                        // Close the frame
                        mlt_events_fire( properties, "consumer-frame-show", frame, NULL );