diff mbox

[6/6] audio: Switch coreaudio to QemuMutex

Message ID 12AA37D0-AEAC-4128-AEBF-A1A18B6F934A@web.de
State New
Headers show

Commit Message

Andreas Färber Sept. 26, 2011, 7:58 a.m. UTC
Hello Jan,

Am 20.09.2011 um 18:53 schrieb Jan Kiszka:

> Using the error management of QemuMutex allows to simplify the code.
> 
> CC: malc <av1474@comtv.ru>
> CC: Andreas Färber <andreas.faerber@web.de>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> audio/coreaudio.c |   56 +++++++---------------------------------------------
> 1 files changed, 8 insertions(+), 48 deletions(-)

You missed one coreaudio_unlock() occurrence in line 187. Other than that looks okay, with some more softfloat workarounds it compiles and doesn't noticeably regress on Darwin/i386 v10.6.8.


Do you have a particular test case? Any parameters needed? I've never used audio in my guests. ;)

Regards,
Andreas

Comments

Jan Kiszka Sept. 26, 2011, 8:06 a.m. UTC | #1
On 2011-09-26 09:58, Andreas Färber wrote:
> Hello Jan,
> 
> Am 20.09.2011 um 18:53 schrieb Jan Kiszka:
> 
>> Using the error management of QemuMutex allows to simplify the code.
>>
>> CC: malc <av1474@comtv.ru>
>> CC: Andreas Färber <andreas.faerber@web.de>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> audio/coreaudio.c |   56 +++++++---------------------------------------------
>> 1 files changed, 8 insertions(+), 48 deletions(-)
> 
> You missed one coreaudio_unlock() occurrence in line 187. Other than that looks okay, with some more softfloat workarounds it compiles and doesn't noticeably regress on Darwin/i386 v10.6.8.
> 
> diff --git a/audio/coreaudio.c b/audio/coreaudio.c
> index c34a593..1cb3fce 100644
> --- a/audio/coreaudio.c
> +++ b/audio/coreaudio.c
> @@ -184,7 +184,7 @@ static int coreaudio_run_out (HWVoiceOut *hw, int live)
>     core->live = live - decr;
>     hw->rpos = core->rpos;
> 
> -    coreaudio_unlock (core, "coreaudio_run_out");
> +    qemu_mutex_unlock(&core->mutex);
>     return decr;
> }
> 
> 
> Do you have a particular test case? Any parameters needed? I've never used audio in my guests. ;)

Nope, I hoped you had. :)

But I received indications that the implicit logging removal is not
welcome. So I will likely refrain from touching the audio subsystem in
the first step.

Thanks,
Jan
diff mbox

Patch

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index c34a593..1cb3fce 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -184,7 +184,7 @@  static int coreaudio_run_out (HWVoiceOut *hw, int live)
    core->live = live - decr;
    hw->rpos = core->rpos;

-    coreaudio_unlock (core, "coreaudio_run_out");
+    qemu_mutex_unlock(&core->mutex);
    return decr;
}