pthread_attr_t thread_attributes;
this->running = 1;
-
+
+ // 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 );
if ( this->sdl_screen != NULL )
{
SDL_SetClipRect( this->sdl_screen, &rect );
-
sdl_lock_display();
- this->sdl_overlay = SDL_CreateYUVOverlay( this->width - (this->width % 4), this->height - (this->height % 2 ), SDL_YUY2_OVERLAY, this->sdl_screen );
+ this->sdl_overlay = SDL_CreateYUVOverlay( this->width, this->height, SDL_YUY2_OVERLAY, this->sdl_screen );
sdl_unlock_display();
}
}
this->buffer = this->sdl_overlay->pixels[ 0 ];
if ( SDL_LockYUVOverlay( this->sdl_overlay ) >= 0 )
{
- memcpy( this->buffer, image, width * height * 2 );
+ if ( image != NULL )
+ memcpy( this->buffer, image, width * height * 2 );
SDL_UnlockYUVOverlay( this->sdl_overlay );
SDL_DisplayYUVOverlay( this->sdl_overlay, &this->sdl_screen->clip_rect );
}
// Stop the consumer
mlt_consumer_stop( parent );
+ // Close the queue
+ mlt_deque_close( this->queue );
+
// Destroy mutexes
pthread_mutex_destroy( &this->audio_mutex );
pthread_cond_destroy( &this->audio_cond );