diff mbox series

[04/23] sdlaudio: don't start playback in init routine

Message ID 20210110100239.27588-4-vr_qemu@t-online.de (mailing list archive)
State New, archived
Headers show
Series next round of audio patches | expand

Commit Message

Volker Rümelin Jan. 10, 2021, 10:02 a.m. UTC
Every emulated audio device has a way to enable audio playback. Don't
start playback until the guest enables the audio device. This patch
keeps the SDL2 device pause state in sync with hw->enabled.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 audio/sdlaudio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Thomas Huth Jan. 15, 2021, 6:28 a.m. UTC | #1
On 10/01/2021 11.02, Volker Rümelin wrote:
> Every emulated audio device has a way to enable audio playback. Don't
> start playback until the guest enables the audio device. This patch
> keeps the SDL2 device pause state in sync with hw->enabled.
> 
> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
> ---
>   audio/sdlaudio.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index 431bfcfddd..68126a99ab 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -312,7 +312,6 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
>   
>       s->initialized = 1;
>       s->exit = 0;
> -    SDL_PauseAudio (0);
>       return 0;
>   }
>   
> 

Right, there is also the sdl_enable_out() function that enables audio when 
necessary.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 431bfcfddd..68126a99ab 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -312,7 +312,6 @@  static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
 
     s->initialized = 1;
     s->exit = 0;
-    SDL_PauseAudio (0);
     return 0;
 }