Merge ../mlt
[melted] / src / modules / sdl / consumer_sdl.c
index e8e0eb3..9870e44 100644 (file)
@@ -252,7 +252,8 @@ int consumer_stop( mlt_consumer parent )
                // Kill the thread and clean up
                this->joined = 1;
                this->running = 0;
-               pthread_join( this->thread, NULL );
+               if ( this->thread )
+                       pthread_join( this->thread, NULL );
 
                // internal cleanup
                if ( this->sdl_overlay != NULL )
@@ -502,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 )