From 93ba5329ea2cadd2ce01b4cceb20f1309fd37bed Mon Sep 17 00:00:00 2001 From: ddennedy Date: Mon, 23 Feb 2009 18:42:07 +0000 Subject: [PATCH] consumer_sdl*.c: apply patch from Jean-Baptiste Mardelle to add window_background property git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1368 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/sdl/consumer_sdl.c | 4 ++++ src/modules/sdl/consumer_sdl_preview.c | 4 ++-- src/modules/sdl/consumer_sdl_still.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 30ec118..9870e44 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -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 ) diff --git a/src/modules/sdl/consumer_sdl_preview.c b/src/modules/sdl/consumer_sdl_preview.c index 73661e2..12b7878 100644 --- a/src/modules/sdl/consumer_sdl_preview.c +++ b/src/modules/sdl/consumer_sdl_preview.c @@ -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." ); diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 942726c..202b434 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -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: -- 1.7.4.4