X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl_preview.c;h=eaaac2eb769636cdce631e569c4e7d597c9ed720;hb=1f6faabf5ef11e6321d186772d88fb6958cdd057;hp=1d8494374aaa124013de413b7f6812b8684386ce;hpb=b41fc3efd457b709d4f9867273f6d0da8921b904;p=melted diff --git a/src/modules/sdl/consumer_sdl_preview.c b/src/modules/sdl/consumer_sdl_preview.c index 1d84943..eaaac2e 100644 --- a/src/modules/sdl/consumer_sdl_preview.c +++ b/src/modules/sdl/consumer_sdl_preview.c @@ -135,19 +135,13 @@ static int consumer_start( mlt_consumer parent ) if ( !this->running ) { - pthread_attr_t thread_attributes; - consumer_stop( parent ); this->running = 1; this->joined = 0; this->last_speed = 1; - // 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 ); + pthread_create( &this->thread, NULL, consumer_thread, this ); } return 0; @@ -210,6 +204,8 @@ static void *consumer_thread( void *arg ) mlt_properties play = MLT_CONSUMER_PROPERTIES( this->play ); mlt_properties still = MLT_CONSUMER_PROPERTIES( this->still ); + int progressive = mlt_properties_get_int( properties, "progressive" ) | mlt_properties_get_int( properties, "deinterlace" ); + if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE ) < 0 ) { fprintf( stderr, "Failed to initialize SDL: %s\n", SDL_GetError() ); @@ -236,9 +232,15 @@ static void *consumer_thread( void *arg ) mlt_properties_set_int( still, "width", mlt_properties_get_int( properties, "width" ) ); mlt_properties_set_int( play, "height", mlt_properties_get_int( properties, "height" ) ); mlt_properties_set_int( still, "height", mlt_properties_get_int( properties, "height" ) ); - - mlt_properties_set_int( play, "progressive", 1 ); - mlt_properties_set_int( still, "progressive", 1 ); + mlt_properties_set_double( play, "aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) ); + mlt_properties_set_double( still, "aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) ); + mlt_properties_set_double( play, "display_ratio", mlt_properties_get_double( properties, "display_ratio" ) ); + mlt_properties_set_double( still, "display_ratio", mlt_properties_get_double( properties, "display_ratio" ) ); + + mlt_properties_set_int( play, "progressive", progressive ); + mlt_properties_set_int( still, "progressive", progressive ); + mlt_properties_set( play, "deinterlace_method", mlt_properties_get( properties, "deinterlace_method" ) ); + mlt_properties_set( still, "deinterlace_method", mlt_properties_get( properties, "deinterlace_method" ) ); mlt_properties_pass( play, MLT_CONSUMER_PROPERTIES( consumer ), "play." ); mlt_properties_pass( still, MLT_CONSUMER_PROPERTIES( consumer ), "still." );