qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4864] Warn about rejected buffer/period size/ time when it was specified by the user
Date: Wed, 09 Jul 2008 19:25:28 +0000	[thread overview]
Message-ID: <E1KGfI8-0004xI-J5@cvs.savannah.gnu.org> (raw)

Revision: 4864
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4864
Author:   malc
Date:     2008-07-09 19:25:28 +0000 (Wed, 09 Jul 2008)

Log Message:
-----------
Warn about rejected buffer/period size/time when it was specified by the user

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

Modified: trunk/audio/alsaaudio.c
===================================================================
--- trunk/audio/alsaaudio.c	2008-07-09 19:25:24 UTC (rev 4863)
+++ trunk/audio/alsaaudio.c	2008-07-09 19:25:28 UTC (rev 4864)
@@ -67,6 +67,7 @@
     snd_pcm_format_t fmt;
     int nchannels;
     int size_in_usec;
+    int override_mask;
     unsigned int buffer_size;
     unsigned int period_size;
 };
@@ -364,7 +365,7 @@
             goto err;
         }
 
-        if (obt - req->buffer_size)
+        if ((req->override_mask & 2) && (obt - req->buffer_size))
             dolog ("Requested buffer %s %u was rejected, using %lu\n",
                    size_in_usec ? "time" : "size", req->buffer_size, obt);
     }
@@ -403,7 +404,7 @@
             goto err;
         }
 
-        if (obt - req->period_size)
+        if ((req->override_mask & 1) && (obt - req->period_size))
             dolog ("Requested period %s %u was rejected, using %lu\n",
                    size_in_usec ? "time" : "size", req->period_size, obt);
     }
@@ -624,6 +625,8 @@
     req.period_size = conf.period_size_out;
     req.buffer_size = conf.buffer_size_out;
     req.size_in_usec = conf.size_in_usec_out;
+    req.override_mask = !!conf.period_size_out_overridden
+        | (!!conf.buffer_size_out_overridden << 1);
 
     if (alsa_open (0, &req, &obt, &handle)) {
         return -1;
@@ -702,6 +705,8 @@
     req.period_size = conf.period_size_in;
     req.buffer_size = conf.buffer_size_in;
     req.size_in_usec = conf.size_in_usec_in;
+    req.override_mask = !!conf.period_size_in_overridden
+        | (!!conf.buffer_size_in_overridden << 1);
 
     if (alsa_open (1, &req, &obt, &handle)) {
         return -1;

                 reply	other threads:[~2008-07-09 19:25 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=E1KGfI8-0004xI-J5@cvs.savannah.gnu.org \
    --to=av1474@comtv.ru \
    --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).