X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=9870e448ea668199afa3c4684afbaf12cfc50e26;hb=f4963a6aa07644399b273b5d2b1f9299c9047414;hp=06cbb2cbba89d9223c8e24bb3c5ee34ed63ee544;hpb=c4612a42677dd9c1c781ead06461f2be6178cae8;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 06cbb2c..9870e44 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -190,9 +190,12 @@ int consumer_start( mlt_consumer parent ) { mlt_profile profile = mlt_service_profile( MLT_CONSUMER_SERVICE( parent ) ); mlt_filter filter = mlt_factory_filter( profile, "avcolour_space", NULL ); - mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "forced", mlt_image_yuv422 ); - mlt_service_attach( MLT_CONSUMER_SERVICE( parent ), filter ); - mlt_filter_close( filter ); + if ( filter ) + { + mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "forced", mlt_image_yuv422 ); + mlt_service_attach( MLT_CONSUMER_SERVICE( parent ), filter ); + mlt_filter_close( filter ); + } this->filtered = 1; } @@ -249,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 ) @@ -499,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 )