X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl_still.c;h=3efd8f4eb63c389338bfcac4eb7d7c23c2eeee3e;hb=1f2e5621296c35af5d2e2e0756087d2e214e7430;hp=942726c1c6a9ef2a2ce9d65ce879697b94f8220c;hpb=d33f444d4ef4c7bc4074d07a49eca0ab7d108394;p=melted diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 942726c..3efd8f4 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -252,6 +252,7 @@ static void sdl_unlock_display( ) static inline void display_1( SDL_Surface *screen, SDL_Rect rect, uint8_t *image, int width, int height ) { // Generate the affine transform scaling values + if ( rect.w == 0 || rect.h == 0 ) return; int scale_width = ( width << 16 ) / rect.w; int scale_height = ( height << 16 ) / rect.h; int stride = width * 3; @@ -281,6 +282,7 @@ static inline void display_1( SDL_Surface *screen, SDL_Rect rect, uint8_t *image static inline void display_2( SDL_Surface *screen, SDL_Rect rect, uint8_t *image, int width, int height ) { // Generate the affine transform scaling values + if ( rect.w == 0 || rect.h == 0 ) return; int scale_width = ( width << 16 ) / rect.w; int scale_height = ( height << 16 ) / rect.h; int stride = width * 3; @@ -310,6 +312,7 @@ static inline void display_2( SDL_Surface *screen, SDL_Rect rect, uint8_t *image static inline void display_3( SDL_Surface *screen, SDL_Rect rect, uint8_t *image, int width, int height ) { // Generate the affine transform scaling values + if ( rect.w == 0 || rect.h == 0 ) return; int scale_width = ( width << 16 ) / rect.w; int scale_height = ( height << 16 ) / rect.h; int stride = width * 3; @@ -343,6 +346,7 @@ static inline void display_3( SDL_Surface *screen, SDL_Rect rect, uint8_t *image static inline void display_4( SDL_Surface *screen, SDL_Rect rect, uint8_t *image, int width, int height ) { // Generate the affine transform scaling values + if ( rect.w == 0 || rect.h == 0 ) return; int scale_width = ( width << 16 ) / rect.w; int scale_height = ( height << 16 ) / rect.h; int stride = width * 3; @@ -431,6 +435,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 +498,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: