X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl_still.c;h=f2146f5eaa82083ad635291dbaf5ddf54f61c955;hb=01d0f9853dd68fc14493db560e4930b2e0e3e0e2;hp=6420dfcc9e7e0a0700d34c54e0481556de74acfa;hpb=df1a6457d0270cc8156b38c59b7479d415847551;p=melted diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 6420dfc..f2146f5 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -158,8 +158,6 @@ static int consumer_start( mlt_consumer parent ) if ( !this->running ) { - pthread_attr_t thread_attributes; - // Attach a colour space converter if ( !this->filtered ) { @@ -185,11 +183,7 @@ static int consumer_start( mlt_consumer parent ) //this->width = this->height * this->display_aspect; - // 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; @@ -418,11 +412,10 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame ) } else { - changed = mlt_properties_get_int( properties, "changed" ) | mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "refresh" ); + changed = 1; mlt_properties_set_int( properties, "changed", 0 ); } - if ( changed == 0 && this->last_position == mlt_frame_get_position( frame ) && this->last_producer == mlt_properties_get_data( MLT_FRAME_PROPERTIES( frame ), "_producer", NULL ) ) @@ -535,7 +528,6 @@ static void *consumer_thread( void *arg ) // internal intialization mlt_frame frame = NULL; - struct timespec tm = { 0, 10000000 }; if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 ) { @@ -568,10 +560,13 @@ static void *consumer_thread( void *arg ) // Ensure that we have a frame if ( frame != NULL ) { - if ( consumer_play_video( this, frame ) == 0 ) - nanosleep( &tm, NULL ); + consumer_play_video( this, frame ); mlt_frame_close( frame ); } + else + { + this->running = 0; + } } if ( mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "sdl_started" ) == 0 )