From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZtH5-0001jt-Se for qemu-devel@nongnu.org; Wed, 18 Feb 2009 15:44:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZtH5-0001jh-A4 for qemu-devel@nongnu.org; Wed, 18 Feb 2009 15:44:07 -0500 Received: from [199.232.76.173] (port=35046 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZtH5-0001je-3W for qemu-devel@nongnu.org; Wed, 18 Feb 2009 15:44:07 -0500 Received: from savannah.gnu.org ([199.232.41.3]:53246 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LZtH4-00021W-E1 for qemu-devel@nongnu.org; Wed, 18 Feb 2009 15:44:06 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LZtH3-00020h-86 for qemu-devel@nongnu.org; Wed, 18 Feb 2009 20:44:05 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LZtH2-00020b-UW for qemu-devel@nongnu.org; Wed, 18 Feb 2009 20:44:05 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Wed, 18 Feb 2009 20:44:04 +0000 Subject: [Qemu-devel] [6627] Avoid running audio ctl's when vm is not running Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6627 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6627 Author: malc Date: 2009-02-18 20:44:04 +0000 (Wed, 18 Feb 2009) Log Message: ----------- Avoid running audio ctl's when vm is not running Modified Paths: -------------- trunk/audio/audio.c trunk/audio/audio_int.h Modified: trunk/audio/audio.c =================================================================== --- trunk/audio/audio.c 2009-02-16 15:47:27 UTC (rev 6626) +++ trunk/audio/audio.c 2009-02-18 20:44:04 UTC (rev 6627) @@ -1127,6 +1127,7 @@ hw = sw->hw; if (sw->active != on) { + AudioState *s = &glob_audio_state; SWVoiceOut *temp_sw; SWVoiceCap *sc; @@ -1134,7 +1135,9 @@ hw->pending_disable = 0; if (!hw->enabled) { hw->enabled = 1; - hw->pcm_ops->ctl_out (hw, VOICE_ENABLE); + if (s->vm_running) { + hw->pcm_ops->ctl_out (hw, VOICE_ENABLE); + } } } else { @@ -1170,12 +1173,15 @@ hw = sw->hw; if (sw->active != on) { + AudioState *s = &glob_audio_state; SWVoiceIn *temp_sw; if (on) { if (!hw->enabled) { hw->enabled = 1; - hw->pcm_ops->ctl_in (hw, VOICE_ENABLE); + if (s->vm_running) { + hw->pcm_ops->ctl_in (hw, VOICE_ENABLE); + } } sw->total_hw_samples_acquired = hw->total_samples_captured; } @@ -1623,6 +1629,7 @@ HWVoiceIn *hwi = NULL; int op = running ? VOICE_ENABLE : VOICE_DISABLE; + s->vm_running = running; while ((hwo = audio_pcm_hw_find_any_enabled_out (s, hwo))) { hwo->pcm_ops->ctl_out (hwo, op); } Modified: trunk/audio/audio_int.h =================================================================== --- trunk/audio/audio_int.h 2009-02-16 15:47:27 UTC (rev 6626) +++ trunk/audio/audio_int.h 2009-02-18 20:44:04 UTC (rev 6627) @@ -192,6 +192,7 @@ LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head; int nb_hw_voices_out; int nb_hw_voices_in; + int vm_running; }; extern struct audio_driver no_audio_driver;