consumer_sdl*.c: apply patch from Jean-Baptiste Mardelle to add window_background...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 23 Feb 2009 18:42:07 +0000 (18:42 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 23 Feb 2009 18:42:07 +0000 (18:42 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1368 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/sdl/consumer_sdl.c
src/modules/sdl/consumer_sdl_preview.c
src/modules/sdl/consumer_sdl_still.c

index 30ec118..9870e44 100644 (file)
@@ -503,6 +503,10 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                        this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
                        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 );
+
+                       uint32_t color = mlt_properties_get_int( this->properties, "window_background" );
+                       SDL_FillRect( this->sdl_screen, NULL, color >> 8 );
+                       SDL_Flip( this->sdl_screen );
                }
 
                if ( this->running )
index 73661e2..12b7878 100644 (file)
@@ -190,8 +190,8 @@ static int consumer_start( mlt_consumer parent )
                mlt_properties_pass_list( still, properties, "resize,rescale,width,height,aspect_ratio,display_ratio" );
                mlt_properties_pass_list( play, properties, "deinterlace_method" );
                mlt_properties_pass_list( still, properties, "deinterlace_method" );
-               mlt_properties_pass_list( play, properties, "preview_off,preview_format" );
-               mlt_properties_pass_list( still, properties, "preview_off,preview_format" );
+               mlt_properties_pass_list( play, properties, "preview_off,preview_format,window_background" );
+               mlt_properties_pass_list( still, properties, "preview_off,preview_format,window_background" );
 
                mlt_properties_pass( play, properties, "play." );
                mlt_properties_pass( still, properties, "still." );
index 942726c..202b434 100644 (file)
@@ -431,6 +431,8 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
                this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags );
                if ( consumer_get_dimensions( &this->window_width, &this->window_height ) )
                        this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags );
+               uint32_t color = mlt_properties_get_int( this->properties, "window_background" );
+               SDL_FillRect( this->sdl_screen, NULL, color >> 8 );
                changed = 1;
        }
        else
@@ -492,8 +494,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
        
        if ( !mlt_consumer_is_stopped( &this->parent ) && SDL_GetVideoSurface( ) != NULL && this->sdl_screen != NULL && this->sdl_screen->pixels != NULL )
        {
-               memset( this->sdl_screen->pixels, 0, this->window_width * this->window_height * this->sdl_screen->format->BytesPerPixel );
-
                switch( this->sdl_screen->format->BytesPerPixel )
                {
                        case 1: