-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
the attached patch should fix the SDL race condition reported here:
http://kdenlive.org/mantis/view.php?id=1762

Did use the patch for some days now (crash happened regularly before).
Similar patch is reported to work by granjow.

regards
Till

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0KcZ0ACgkQzwEyz7QP6nTocACgkXR8eUueZyhVYTaV9DQtkFTf
IFIAn0uvfPdQUusEuU/6QSBtcxSm0TDg
=5iFC
-----END PGP SIGNATURE-----
>From 5de7351ba3a2b757835a095ed0eed1c963370246 Mon Sep 17 00:00:00 2001
From: Till Theato <[email protected]>
Date: Thu, 16 Dec 2010 20:54:08 +0100
Subject: [PATCH] Fix another race condition in the SDL consumer (kdenlive-1762).

---
 src/modules/sdl/consumer_sdl_still.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c
index 30ca615..8a423db 100644
--- a/src/modules/sdl/consumer_sdl_still.c
+++ b/src/modules/sdl/consumer_sdl_still.c
@@ -513,7 +513,6 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
 	
 	pthread_mutex_lock( &mlt_sdl_mutex );
 	SDL_Surface *screen = SDL_GetVideoSurface( );
-	pthread_mutex_unlock( &mlt_sdl_mutex );
 	if ( !mlt_consumer_is_stopped( &this->parent ) && screen != NULL && this->sdl_screen != NULL && this->sdl_screen->pixels != NULL )
 	{
 		switch( this->sdl_screen->format->BytesPerPixel )
@@ -536,10 +535,9 @@ static int consumer_play_video( consumer_sdl this, mlt_frame frame )
 		}
 
 		// Flip it into sight
-		pthread_mutex_lock( &mlt_sdl_mutex );
 		SDL_Flip( this->sdl_screen );
-		pthread_mutex_unlock( &mlt_sdl_mutex );
 	}
+	pthread_mutex_unlock( &mlt_sdl_mutex );
 
 	sdl_unlock_display();
 	mlt_cocoa_autorelease_close( pool );
-- 
1.7.3.3


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to