]> git.sesse.net Git - mlt/blobdiff - src/modules/sdl/consumer_sdl_still.c
consumer_sdl_still.c: bugfix segfault
[mlt] / src / modules / sdl / consumer_sdl_still.c
index 433ba896d449b77df2c56074f42273a6f2dc40ab..9250f8dc4d68f844d85183ceb718082d4f3b26f8 100644 (file)
@@ -87,9 +87,6 @@ mlt_consumer consumer_sdl_still_init( char *arg )
                mlt_service service = MLT_CONSUMER_SERVICE( parent );
                this->properties = MLT_SERVICE_PROPERTIES( service );
 
-               // Get the default display ratio
-               double display_ratio = mlt_properties_get_double( this->properties, "display_ratio" );
-
                // We have stuff to clean up, so override the close method
                parent->close = consumer_close;
 
@@ -117,10 +114,6 @@ mlt_consumer consumer_sdl_still_init( char *arg )
                        mlt_properties_set_int( this->properties, "height", this->height );
                }
 
-               // Default window size
-               this->window_width = ( double )this->height * display_ratio;
-               this->window_height = this->height;
-
                // Set the sdl flags
                this->sdl_flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_RESIZABLE | SDL_DOUBLEBUF;
 
@@ -178,6 +171,11 @@ static int consumer_start( mlt_consumer parent )
                this->width = mlt_properties_get_int( this->properties, "width" );
                this->height = mlt_properties_get_int( this->properties, "height" );
 
+               // Default window size
+               double display_ratio = mlt_properties_get_double( this->properties, "display_ratio" );
+               this->window_width = ( double )this->height * display_ratio;
+               this->window_height = this->height;
+
                if ( sdl_started == 0 && preview_off == 0 )
                {
                        if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE ) < 0 )
@@ -194,7 +192,6 @@ static int consumer_start( mlt_consumer parent )
                        if ( SDL_GetVideoSurface( ) != NULL )
                        {
                                this->sdl_screen = SDL_GetVideoSurface( );
-                               consumer_get_dimensions( &this->window_width, &this->window_height );
                        }
                }