]> git.sesse.net Git - mlt/commitdiff
Make xml consumer respect video_off and audio_off.
authorDan Dennedy <dan@dennedy.org>
Sun, 10 Nov 2013 21:43:30 +0000 (13:43 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 10 Nov 2013 21:43:30 +0000 (13:43 -0800)
src/modules/xml/consumer_xml.c

index dde68f0d3a4aeecc018ecb6ca0093df06d8aae0e..77226db00eb6390676d0259ff35a383853eb33e2 100644 (file)
@@ -920,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" ) )
        {
@@ -941,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 );