qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] audio: previous audio buffer should be flushed
@ 2012-08-27 10:53 munkyu.im
  2012-08-27 10:53 ` munkyu.im
  0 siblings, 1 reply; 4+ messages in thread
From: munkyu.im @ 2012-08-27 10:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: munkyu.im

*** BLURB HERE ***

munkyu.im (1):
  audio: previous audio buffer should be flushed

 audio/winwaveaudio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] audio: previous audio buffer should be flushed
  2012-08-27 10:53 [Qemu-devel] [PATCH] audio: previous audio buffer should be flushed munkyu.im
@ 2012-08-27 10:53 ` munkyu.im
  0 siblings, 0 replies; 4+ messages in thread
From: munkyu.im @ 2012-08-27 10:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: munkyu.im

Buffer must be flushed when audio out is paused, but Winwave audio backend has problem with this unlike other backends.
As a result, when user stop and restart audio files or something, the previous audio data are played in front of user expected sound.
So changes it to waveOutReset()
---
 audio/winwaveaudio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c
index 663abb9..7de12a6 100644
--- a/audio/winwaveaudio.c
+++ b/audio/winwaveaudio.c
@@ -361,9 +361,9 @@ static int winwave_ctl_out (HWVoiceOut *hw, int cmd, ...)
 
     case VOICE_DISABLE:
         if (!wave->paused) {
-            mr = waveOutPause (wave->hwo);
+            mr = waveOutReset (wave->hwo);
             if (mr != MMSYSERR_NOERROR) {
-                winwave_logerr (mr, "waveOutPause");
+                winwave_logerr (mr, "waveOutReset");
             }
             else {
                 wave->paused = 1;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH]] audio: previous audio buffer should be flushed
@ 2012-08-28  7:42 munkyu.im
  2012-08-28 15:12 ` malc
  0 siblings, 1 reply; 4+ messages in thread
From: munkyu.im @ 2012-08-28  7:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: munkyu.im

Winwave audio backend has problem with pausing and restart audio out.
Unlike other backends, Winwave pausing API does not flush audio buffer.
As a result, the previous audio data are playedin front of
user expected sound when user restart audio.
So changes it to waveOutReset()

Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
---
 audio/winwaveaudio.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c
index 663abb9..72babbf 100644
--- a/audio/winwaveaudio.c
+++ b/audio/winwaveaudio.c
@@ -349,21 +349,15 @@ static int winwave_ctl_out (HWVoiceOut *hw, int cmd, ...)
             else {
                 hw->poll_mode = 0;
             }
-            if (wave->paused) {
-                mr = waveOutRestart (wave->hwo);
-                if (mr != MMSYSERR_NOERROR) {
-                    winwave_logerr (mr, "waveOutRestart");
-                }
-                wave->paused = 0;
-            }
+            wave->paused = 0;
         }
         return 0;
 
     case VOICE_DISABLE:
         if (!wave->paused) {
-            mr = waveOutPause (wave->hwo);
+            mr = waveOutReset (wave->hwo);
             if (mr != MMSYSERR_NOERROR) {
-                winwave_logerr (mr, "waveOutPause");
+                winwave_logerr (mr, "waveOutReset");
             }
             else {
                 wave->paused = 1;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH]] audio: previous audio buffer should be flushed
  2012-08-28  7:42 [Qemu-devel] [PATCH]] " munkyu.im
@ 2012-08-28 15:12 ` malc
  0 siblings, 0 replies; 4+ messages in thread
From: malc @ 2012-08-28 15:12 UTC (permalink / raw)
  To: munkyu.im; +Cc: qemu-devel

On Tue, 28 Aug 2012, munkyu.im wrote:

> Winwave audio backend has problem with pausing and restart audio out.
> Unlike other backends, Winwave pausing API does not flush audio buffer.
> As a result, the previous audio data are playedin front of
> user expected sound when user restart audio.
> So changes it to waveOutReset()
> 
> Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
> ---
>  audio/winwaveaudio.c |   12 +++---------
>  1 files changed, 3 insertions(+), 9 deletions(-)
> 

Thanks, applied with some cosmetics changes to the commit message.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-28 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 10:53 [Qemu-devel] [PATCH] audio: previous audio buffer should be flushed munkyu.im
2012-08-27 10:53 ` munkyu.im
  -- strict thread matches above, loose matches on Subject: below --
2012-08-28  7:42 [Qemu-devel] [PATCH]] " munkyu.im
2012-08-28 15:12 ` malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).