]> git.sesse.net Git - mlt/commitdiff
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 30ec118f6e48b11f3d1af3ec73f55fd91b2d7569..9870e448ea668199afa3c4684afbaf12cfc50e26 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 73661e24912742d25507f751ed321362fdb9d15b..12b78782707f4c58195318f78bb4b412eda4de4e 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 942726c1c6a9ef2a2ce9d65ce879697b94f8220c..202b4345a56273d6eabfe60887e8188735e6c44b 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: