X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl.c;h=0d17499b42402263d529de64b161df8d815bf5a6;hb=c1333ab3917e63f8bc4684aa4cee0a1984a61c04;hp=d94022b2883cadc0da0ba43a8059375abde962e6;hpb=34caefec7aa0334f38a649838cf3ab9db7388b27;p=melted diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index d94022b..0d17499 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -166,8 +166,22 @@ int consumer_start( mlt_consumer parent ) if ( !this->running ) { + pthread_attr_t thread_attributes; + this->running = 1; - pthread_create( &this->thread, NULL, consumer_thread, this ); + + // 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 ); + + pthread_create( &this->thread, &thread_attributes, consumer_thread, this ); } return 0;