From: lilo_booter Date: Tue, 23 Dec 2003 14:12:51 +0000 (+0000) Subject: SDL fixes on close X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=fc579010c07e3daa94db446a9623d9bb996892d2;p=melted SDL fixes on close git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@14 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt/src/modules/sdl/consumer_sdl.c b/mlt/src/modules/sdl/consumer_sdl.c index 59196d2..c75237e 100644 --- a/mlt/src/modules/sdl/consumer_sdl.c +++ b/mlt/src/modules/sdl/consumer_sdl.c @@ -351,8 +351,12 @@ static void consumer_close( mlt_consumer parent ) // Kill the thread and clean up this->running = 0; - pthread_join( this->thread, NULL ); + pthread_mutex_lock( &this->audio_mutex ); + pthread_cond_broadcast( &this->audio_cond ); + pthread_mutex_unlock( &this->audio_mutex ); + + pthread_join( this->thread, NULL ); pthread_mutex_destroy( &this->audio_mutex ); pthread_cond_destroy( &this->audio_cond ); diff --git a/mlt/src/tests/charlie.c b/mlt/src/tests/charlie.c index 95935cb..65f5099 100644 --- a/mlt/src/tests/charlie.c +++ b/mlt/src/tests/charlie.c @@ -81,6 +81,10 @@ int main( int argc, char **argv ) // Transport functionality transport( producer ); + // Close the services + mlt_consumer_close( consumer ); + mlt_producer_close( producer ); + /* // Create the producer(s) mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); diff --git a/mlt/src/tests/dan.c b/mlt/src/tests/dan.c index d22f0a9..cdfd211 100644 --- a/mlt/src/tests/dan.c +++ b/mlt/src/tests/dan.c @@ -71,11 +71,11 @@ int main( int argc, char **argv ) // Close everything... mlt_consumer_close( consumer ); - //mlt_tractor_close( tractor ); + mlt_tractor_close( tractor ); //mlt_filter_close( filter ); - //mlt_multitrack_close( multitrack ); - //mlt_producer_close( dv1 ); - //mlt_producer_close( dv2 ); + mlt_multitrack_close( multitrack ); + mlt_producer_close( dv1 ); + mlt_producer_close( dv2 ); return 0; } diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 59196d2..c75237e 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -351,8 +351,12 @@ static void consumer_close( mlt_consumer parent ) // Kill the thread and clean up this->running = 0; - pthread_join( this->thread, NULL ); + pthread_mutex_lock( &this->audio_mutex ); + pthread_cond_broadcast( &this->audio_cond ); + pthread_mutex_unlock( &this->audio_mutex ); + + pthread_join( this->thread, NULL ); pthread_mutex_destroy( &this->audio_mutex ); pthread_cond_destroy( &this->audio_cond ); diff --git a/src/tests/charlie.c b/src/tests/charlie.c index 95935cb..65f5099 100644 --- a/src/tests/charlie.c +++ b/src/tests/charlie.c @@ -81,6 +81,10 @@ int main( int argc, char **argv ) // Transport functionality transport( producer ); + // Close the services + mlt_consumer_close( consumer ); + mlt_producer_close( producer ); + /* // Create the producer(s) mlt_producer dv1 = mlt_factory_producer( "mcmpeg", file1 ); diff --git a/src/tests/dan.c b/src/tests/dan.c index d22f0a9..cdfd211 100644 --- a/src/tests/dan.c +++ b/src/tests/dan.c @@ -71,11 +71,11 @@ int main( int argc, char **argv ) // Close everything... mlt_consumer_close( consumer ); - //mlt_tractor_close( tractor ); + mlt_tractor_close( tractor ); //mlt_filter_close( filter ); - //mlt_multitrack_close( multitrack ); - //mlt_producer_close( dv1 ); - //mlt_producer_close( dv2 ); + mlt_multitrack_close( multitrack ); + mlt_producer_close( dv1 ); + mlt_producer_close( dv2 ); return 0; }