X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl_still.c;h=7462b0d7f1714b0550e93144e6a722187d8bb404;hb=5941e41209b87a8ed26f273f170abbd484113938;hp=c0848dbec4e0b46c77bc699b6615f862df358e74;hpb=efd5f25f6fe70f75f9787e9c7f2b53730ecf6048;p=melted diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index c0848db..7462b0d 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -113,7 +113,7 @@ mlt_consumer consumer_sdl_still_init( char *arg ) } // Default window size - this->window_width = ( float )this->height * display_ratio; + this->window_width = ( double )this->height * display_ratio; this->window_height = this->height; // Set the sdl flags @@ -432,7 +432,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) char *rescale = mlt_properties_get( properties, "rescale" ); if ( rescale != NULL && strcmp( rescale, "none" ) ) { - float this_aspect = display_ratio / ( ( float )this->window_width / ( float )this->window_height ); + double this_aspect = display_ratio / ( ( double )this->window_width / ( double )this->window_height ); this->rect.w = this_aspect * this->window_width; this->rect.h = this->window_height; if ( this->rect.w > this->window_width ) @@ -443,7 +443,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) } else { - float frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height; + double frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height; this->rect.w = frame_aspect * this->window_height; this->rect.h = this->window_height; if ( this->rect.w > this->window_width ) @@ -539,13 +539,14 @@ static void *consumer_thread( void *arg ) frame = mlt_consumer_rt_frame( consumer ); // Ensure that we have a frame - if ( frame != NULL ) + if ( this->running && frame != NULL ) { consumer_play_video( this, frame ); mlt_frame_close( frame ); } else { + if ( frame ) mlt_frame_close( frame ); this->running = 0; } }