qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Zaborowski <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4296] Audio endianness and mutex usage fixes (malc.git).
Date: Fri, 02 May 2008 02:24:55 +0000	[thread overview]
Message-ID: <E1JrkxD-0007Fr-SA@cvs.savannah.gnu.org> (raw)

Revision: 4296
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4296
Author:   balrog
Date:     2008-05-02 02:24:55 +0000 (Fri, 02 May 2008)

Log Message:
-----------
Audio endianness and mutex usage fixes (malc.git).

>From http://repo.or.cz/w/qemu/malc.git?a=shortlog;h=refs/heads/audio :

Implicitly lock the mutex at startup of playback/capture threads, otherwise
pthread_mutex_destroy (in audio_pt_fini) fails with EBUSY.
Endianness fix.
Remove a c&p residue.

Modified Paths:
--------------
    trunk/audio/esdaudio.c

Modified: trunk/audio/esdaudio.c
===================================================================
--- trunk/audio/esdaudio.c	2008-05-02 01:35:20 UTC (rev 4295)
+++ trunk/audio/esdaudio.c	2008-05-02 02:24:55 UTC (rev 4296)
@@ -84,6 +84,10 @@
 
     threshold = conf.divisor ? hw->samples / conf.divisor : 0;
 
+    if (audio_pt_lock (&esd->pt, AUDIO_FUNC)) {
+        return NULL;
+    }
+
     for (;;) {
         int decr, to_mix, rpos;
 
@@ -215,13 +219,10 @@
 
     default:
         dolog ("Internal logic error: Bad audio format %d\n", as->fmt);
-#ifdef DEBUG_FMOD
-        abort ();
-#endif
         goto deffmt;
 
     }
-    obt_as.endianness = 0;
+    obt_as.endianness = AUDIO_HOST_ENDIANNESS;
 
     audio_pcm_init_info (&hw->info, &obt_as);
 
@@ -315,6 +316,10 @@
 
     threshold = conf.divisor ? hw->samples / conf.divisor : 0;
 
+    if (audio_pt_lock (&esd->pt, AUDIO_FUNC)) {
+        return NULL;
+    }
+
     for (;;) {
         int incr, to_grab, wpos;
 
@@ -447,7 +452,7 @@
         obt_as.fmt = AUD_FMT_S16;
         break;
     }
-    obt_as.endianness = 0;
+    obt_as.endianness = AUDIO_HOST_ENDIANNESS;
 
     audio_pcm_init_info (&hw->info, &obt_as);
 

                 reply	other threads:[~2008-05-02  2:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JrkxD-0007Fr-SA@cvs.savannah.gnu.org \
    --to=balrogg@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).