From 65eaba6f51c7e693c09121ab667b8622323cb0ab Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Sun, 20 Jan 2013 16:15:36 -0500 Subject: [PATCH] Fix some synchronization issues. Improve audio job debug output * src/media/sound.c (make_audio_job): Always initialie the mutex since some sound backends are multi-threaded and will use the mutex. Jack and AO are examples. * src/media/sound.c (make_audio_job): Improve the job log message. * src/media/sound.c (play-media-stream-synchronously): Improve play log message to make clear this is synchronous play. Signed-off-by: Nelson Ferreira --- src/media/sound.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/media/sound.c b/src/media/sound.c index 681b14c..0b1fdea 100644 --- a/src/media/sound.c +++ b/src/media/sound.c @@ -408,8 +408,8 @@ make_audio_job(Lisp_Object stream, Lisp_Object device, Lisp_Object sentinel) aj->state = MTSTATE_UNKNOWN; aj->play_state = MTPSTATE_UNKNOWN; -#ifdef EF_USE_ASYNEQ SXE_MUTEX_INIT(&aj->mtx); +#ifdef EF_USE_ASYNEQ audio_job_queue(aj) = NULL; #endif @@ -419,7 +419,9 @@ make_audio_job(Lisp_Object stream, Lisp_Object device, Lisp_Object sentinel) aj->buffer = NULL; aj->buffer_alloc_size = 0; - SOUND_DEBUG_AJ("created: 0x%lx\n", (long unsigned int)aj); + SOUND_DEBUG_AJ("created: 0x%lx stream 0x%lx device 0x%lx sentinel 0x%lx\n", + (long unsigned int)aj, (long unsigned int)stream, + (long unsigned int)device, (long unsigned int) sentinel); return aj; } @@ -542,7 +544,7 @@ the playback volume. aj->queue = NULL; #endif - SOUND_DEBUG_AJ("calling play meth\n"); + SOUND_DEBUG_AJ("sync calling play meth\n"); XAUDIO_DEVICE(device)->meths->play(aj); if (!NILP(sentinel)) { -- 2.25.1