Fixes Coverity CID 709360: Data race condition (MISSING_LOCK)
Locking "this->refresh_mutex".
133 pthread_mutex_lock( &this->refresh_mutex );
consumer_sdl_s.refresh_count is being accessed with lock "this->refresh_mutex" held.
134 this->refresh_count = this->refresh_count <= 0 ? 1 : this->refresh_count + 1;
135 pthread_cond_broadcast( &this->refresh_cond );
136 pthread_mutex_unlock( &this->refresh_mutex );
...
Accessing variable "this->refresh_count" (consumer_sdl_s.refresh_count) requires the consumer_sdl_s.refresh_mutex lock.
295 this->refresh_count = 0;
...
Locking "this->refresh_mutex".
445 pthread_mutex_lock( &this->refresh_mutex );
446 if ( this->running && speed == 0 && this->refresh_count <= 0 )
447 {
448 mlt_events_fire( properties, "consumer-sdl-paused", NULL );
449 pthread_cond_wait( &this->refresh_cond, &this->refresh_mutex );
450 }
consumer_sdl_s.refresh_count is being accessed with lock "this->refresh_mutex" held.
451 this->refresh_count --;
452 pthread_mutex_unlock( &this->refresh_mutex );
// Determine if the application is dealing with the preview
int preview_off = mlt_properties_get_int( properties, "preview_off" );
+ pthread_mutex_lock( &this->refresh_mutex );
this->refresh_count = 0;
+ pthread_mutex_unlock( &this->refresh_mutex );
// Loop until told not to
while( this->running )