summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-11-18 22:59:29 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-11-18 22:59:29 +0000
commitd1a0dcf834839099496c98736b23d410a1604bb9 (patch)
tree29ab52d8f30eb0448f14a3b07524ea1b6ea78c34
parent6d75a9ef8bb92e3a4fcbe7770bb5564b9ffe467b (diff)
downloadxine-lib-d1a0dcf834839099496c98736b23d410a1604bb9.tar.gz
xine-lib-d1a0dcf834839099496c98736b23d410a1604bb9.tar.bz2
make audio_out close faster
CVS patchset: 1072 CVS date: 2001/11/18 22:59:29
-rw-r--r--src/xine-engine/audio_out.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index a3dbd5319..89eaa0240 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.31 2001/11/18 03:53:25 guenter Exp $
+ * $Id: audio_out.c,v 1.32 2001/11/18 22:59:29 miguelfreitas Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -346,7 +346,7 @@ static void *ao_loop (void *this_gen) {
* output audio data synced to master clock
*/
- if (gap < (-1 * this->gap_tolerance)) {
+ if (gap < (-1 * this->gap_tolerance) || !this->audio_loop_running) {
/* drop package */
@@ -572,6 +572,10 @@ static int ao_open(ao_instance_t *this,
* start output thread
*/
+ if( this->audio_thread ) {
+ printf("audio_out: pthread already running!\n");
+ }
+
if ((err = pthread_create (&this->audio_thread,
NULL, ao_loop, this)) != 0) {
@@ -635,6 +639,7 @@ static void ao_close(ao_instance_t *this) {
fifo_append (this->out_fifo, audio_buffer);
pthread_join (this->audio_thread, &p);
+ this->audio_thread = NULL;
}
printf ("audio_out: thread stopped, closing driver\n");