Fixes Coverity CID 709357 and 709358: Data race condition (MISSING_LOCK)
Locking "mlt_sdl_mutex".
235 pthread_mutex_lock( &mlt_sdl_mutex );
consumer_sdl_s.sdl_screen is being accessed with lock "mlt_sdl_mutex" held.
236 this->sdl_screen = SDL_GetVideoSurface( );
237 pthread_mutex_unlock( &mlt_sdl_mutex );
...
Locking "mlt_sdl_mutex".
269 pthread_mutex_lock( &mlt_sdl_mutex );
consumer_sdl_s.sdl_screen is being accessed with lock "mlt_sdl_mutex" held.
270 this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, 0, this->sdl_flags );
271 pthread_mutex_unlock( &mlt_sdl_mutex );
...
Accessing variable "this->sdl_screen" (consumer_sdl_s.sdl_screen) requires the mlt_sdl_mutex lock.
315 this->sdl_screen = NULL;
...
Locking "mlt_sdl_mutex".
573 pthread_mutex_lock( &mlt_sdl_mutex );
consumer_sdl_s.sdl_screen is being accessed with lock "mlt_sdl_mutex" held.
574 this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
575 if ( consumer_get_dimensions( &this->window_width, &this->window_height ) )
consumer_sdl_s.sdl_screen is being accessed with lock "mlt_sdl_mutex" held.
576 this->sdl_screen = SDL_SetVideoMode( this->window_width, this->window_height, this->bpp, this->sdl_flags );
577 pthread_mutex_unlock( &mlt_sdl_mutex );
pthread_mutex_unlock( &mlt_sdl_mutex );
}
+ pthread_mutex_lock( &mlt_sdl_mutex );
this->sdl_screen = NULL;
+ pthread_mutex_unlock( &mlt_sdl_mutex );
}
return 0;
while( mlt_deque_count( this->queue ) )
mlt_frame_close( mlt_deque_pop_back( this->queue ) );
+ pthread_mutex_lock( &mlt_sdl_mutex );
this->sdl_screen = NULL;
+ pthread_mutex_unlock( &mlt_sdl_mutex );
this->audio_avail = 0;
return NULL;