+ if ( this->running && ( this->sdl_screen == NULL || changed ) )
+ {
+ // Force an overlay recreation
+ if ( this->sdl_overlay != NULL )
+ SDL_FreeYUVOverlay( this->sdl_overlay );
+ this->sdl_overlay = NULL;
+
+ // open SDL window with video overlay, if possible
+ sdl_lock_display();
+ this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
+ sdl_unlock_display();
+ if ( consumer_get_dimensions( &this->window_width, &this->window_height ) )
+ this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
+ //SDL_Flip( this->sdl_screen );
+ mlt_properties_set_int( properties, "changed", 0 );
+ }
+ else if ( mlt_properties_get_int( properties, "changed" ) )
+ {
+ sdl_lock_display();
+ this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
+ SDL_SetClipRect( this->sdl_screen, &this->rect );
+ sdl_unlock_display();
+ mlt_properties_set_int( properties, "changed", 0 );
+ }
+
+ if ( this->running )