X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=0d17499b42402263d529de64b161df8d815bf5a6;hb=c1333ab3917e63f8bc4684aa4cee0a1984a61c04;hp=bf7e3fd50e12cd561a408cb83405128c963ac3b0;hpb=f9ae36b8488bf8f32a40d482171df888913e28cd;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index bf7e3fd..0d17499 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -169,7 +169,14 @@ int consumer_start( mlt_consumer parent ) pthread_attr_t thread_attributes; this->running = 1; - + + // Allow the user to force resizing to window size + if ( mlt_properties_get_int( this->properties, "resize" ) ) + { + mlt_properties_set_int( this->properties, "width", this->width ); + mlt_properties_set_int( this->properties, "height", this->height ); + } + // Inherit the scheduling priority pthread_attr_init( &thread_attributes ); pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED ); @@ -397,6 +404,8 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) changed = 1; } + if ( this->sdl_screen == NULL || changed ) + { SDL_Rect rect; // Determine frame's display aspect ratio @@ -451,8 +460,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) rect.x = ( this->window_width - rect.w ) / 2; rect.y = ( this->window_height - rect.h ) / 2; - if ( this->sdl_screen == NULL || changed ) - { // Force an overlay recreation if ( this->sdl_overlay != NULL ) SDL_FreeYUVOverlay( this->sdl_overlay ); @@ -469,11 +476,7 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) sdl_unlock_display(); } } - else - { - SDL_SetClipRect( this->sdl_screen, &rect ); - } - + if ( this->sdl_screen != NULL && this->sdl_overlay != NULL ) { this->buffer = this->sdl_overlay->pixels[ 0 ];