qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1.1] audio: Always call fini on exit


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1.1] audio: Always call fini on exit
Date: Thu, 24 May 2012 09:11:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120422 Thunderbird/10.0.4

On 05/03/12 20:56, Jan Kiszka wrote:
> Not only clean up enabled voices but any registered one. Backends like
> pulsaudio rely on unconditional fini handler invocations.
> 
> This fixes "Memory pool destroyed but not all memory blocks freed!"
> warnings on VM shutdowns when pa is used.
> 
> Signed-off-by: Jan Kiszka <address@hidden>
> ---
>  audio/audio.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/audio/audio.c b/audio/audio.c
> index bd9237e..4b6e06c 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1775,7 +1775,7 @@ static void audio_atexit (void)
>      HWVoiceOut *hwo = NULL;
>      HWVoiceIn *hwi = NULL;
>  
> -    while ((hwo = audio_pcm_hw_find_any_enabled_out (hwo))) {
> +    while ((hwo = audio_pcm_hw_find_any_out (hwo))) {
>          SWVoiceCap *sc;
>  
>          hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE);

I think you better call VOICE_DISABLE only in case the voice is actually
enabled.

> @@ -1791,7 +1791,7 @@ static void audio_atexit (void)
>          }
>      }
>  
> -    while ((hwi = audio_pcm_hw_find_any_enabled_in (hwi))) {
> +    while ((hwi = audio_pcm_hw_find_any_in (hwi))) {
>          hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE);

Likewise.

>          hwi->pcm_ops->fini_in (hwi);
>      }

cheers,
  Gerd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]