From 6a58c9d7b115eb433906baf2bdb15f3d012a262e Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sun, 27 Jun 2004 13:33:57 +0000 Subject: only issue the warning on unavailable audio devices under the condition (in_buf && in_buf->num_frames), otherwise, the dummy packet send by ao_exit() to wake up the audio out loop can trigger this message (because it has an undefined buf->format.rate, which, when 0 causes driver->open() to fail and the message gets emitted) we also send the message to the streams attached to this audio out only, not to all streams known to the engine CVS patchset: 6757 CVS date: 2004/06/27 13:33:57 --- src/xine-engine/audio_out.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 9f20efe00..83401599b 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.180 2004/06/19 20:07:15 mroi Exp $ + * $Id: audio_out.c,v 1.181 2004/06/27 13:33:57 mroi Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe @@ -1002,19 +1002,21 @@ static void *ao_loop (void *this_gen) { delay = 0; pthread_mutex_unlock( &this->driver_lock ); - xprintf(this->xine, XINE_VERBOSITY_LOG, - _("audio_out: delay calculation impossible with an unavailable audio device\n")); + + if (in_buf && in_buf->num_frames) { + xprintf(this->xine, XINE_VERBOSITY_LOG, + _("audio_out: delay calculation impossible with an unavailable audio device\n")); - pthread_mutex_lock(&this->xine->streams_lock); - for (stream = xine_list_first_content(this->xine->streams); - stream; stream = xine_list_next_content(this->xine->streams)) - { - _x_message (stream, XINE_MSG_AUDIO_OUT_UNAVAILABLE, NULL); - /* This is necessary for the message to get to the front-end at some - * point before another message is sent */ - sched_yield(); + pthread_mutex_lock(&this->streams_lock); + for (stream = xine_list_first_content(this->streams); + stream; stream = xine_list_next_content(this->streams)) { + _x_message (stream, XINE_MSG_AUDIO_OUT_UNAVAILABLE, NULL); + /* This is necessary for the message to get to the front-end at some + * point before another message is sent */ + sched_yield(); + } + pthread_mutex_unlock(&this->streams_lock); } - pthread_mutex_unlock(&this->xine->streams_lock); } cur_time = this->clock->get_current_time (this->clock); -- cgit v1.2.3