]> git.sesse.net Git - mlt/commitdiff
Make it easier to embed sdl in Windows applications.
authorDan Dennedy <dan@dennedy.org>
Mon, 27 Jun 2011 06:07:08 +0000 (23:07 -0700)
committerunknown <ddennedy@.mobitv.corp>
Mon, 27 Jun 2011 06:07:08 +0000 (23:07 -0700)
src/modules/sdl/consumer_sdl.c

index 9e58ec8f6c28f0a9689444556f004b79120fbf3b..1f8b9ce4e9f2b86936cf70647fdbd8bf4bd6d77a 100644 (file)
@@ -180,12 +180,32 @@ int consumer_start( mlt_consumer parent )
                int display_off = video_off | preview_off;
                int audio_off = mlt_properties_get_int( properties, "audio_off" );
                int sdl_started = mlt_properties_get_int( properties, "sdl_started" );
+               char *output_display = mlt_properties_get( properties, "output_display" );
+               char *window_id = mlt_properties_get( properties, "window_id" );
+               char *audio_driver = mlt_properties_get( properties, "audio_driver" );
+               char *video_driver = mlt_properties_get( properties, "video_driver" );
+               char *audio_device = mlt_properties_get( properties, "audio_device" );
 
                consumer_stop( parent );
 
                this->running = 1;
                this->joined = 0;
 
+               if ( output_display != NULL )
+                       setenv( "DISPLAY", output_display, 1 );
+
+               if ( window_id != NULL )
+                       setenv( "SDL_WINDOWID", window_id, 1 );
+
+               if ( video_driver != NULL )
+                       setenv( "SDL_VIDEODRIVER", video_driver, 1 );
+
+               if ( audio_driver != NULL )
+                       setenv( "SDL_AUDIODRIVER", audio_driver, 1 );
+
+               if ( audio_device != NULL )
+                       setenv( "AUDIODEV", audio_device, 1 );
+
                if ( ! mlt_properties_get_int( this->properties, "_arg_size" ) )
                {
                        if ( mlt_properties_get_int( this->properties, "width" ) > 0 )