Hello community,

here is the log from the commit of package alsa-plugins for openSUSE:Factory
checked in at Sun Sep 11 19:03:34 CEST 2011.



--------
--- alsa-plugins/alsa-plugins.changes   2011-08-08 09:23:53.000000000 +0200
+++ /mounts/work_src_done/STABLE/alsa-plugins/alsa-plugins.changes      
2011-08-26 10:06:26.000000000 +0200
@@ -1,0 +2,10 @@
+Fri Aug 26 09:47:29 CEST 2011 - [email protected]
+
+- Fix the build of pulse plugin with a very old PA
+
+-------------------------------------------------------------------
+Fri Aug 26 09:31:00 CEST 2011 - [email protected]
+
+- Add a better overrun handling with the new PA API
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  0006-pulse-only-underrun-if-no-more-data-has-been-written.patch
  0007-pulse-Define-a-dummy-PA_CHECK_VERSION-when-not-avail.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ alsa-plugins.spec ++++++
--- /var/tmp/diff_new_pack.Kzo38G/_old  2011-09-11 19:03:28.000000000 +0200
+++ /var/tmp/diff_new_pack.Kzo38G/_new  2011-09-11 19:03:28.000000000 +0200
@@ -38,7 +38,7 @@
 Url:            http://www.alsa-project.org/
 Summary:        Extra Plug-Ins for the ALSA Library
 Version:        1.0.24
-Release:        11
+Release:        13
 License:        LGPLv2.1+
 Group:          System/Libraries
 AutoReqProv:    on
@@ -54,6 +54,8 @@
 Patch3:         0003-pulse-Add-fallback-option.patch
 Patch4:         0004-pulse-Set-PA_CONTEXT_NOAUTOSPAWN-when-fallback-is-av.patch
 Patch5:         0005-jack-Fix-hanging-applications-when-using-jack-plugin.patch
+Patch6:         0006-pulse-only-underrun-if-no-more-data-has-been-written.patch
+Patch7:         0007-pulse-Define-a-dummy-PA_CHECK_VERSION-when-not-avail.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -173,6 +175,8 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 export AUTOMAKE_JOBS=%{?jobs:%jobs}

++++++ 0006-pulse-only-underrun-if-no-more-data-has-been-written.patch ++++++
>From 3854daba604370d3dd7057407b946311bb184122 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Tue, 23 Aug 2011 17:02:17 +0200
Subject: [PATCH] pulse - only underrun if no more data has been written

Original patch from David Henningsson <[email protected]>

If more data has already been written after the underrun, the underrun
will automatically end and therefore we should not report it or
restart the stream.

[ This patch adds a more check of underrun with a new PA function so
  that the underrun handles works more reliably.  As the feature is
  supported only in a recent version of PA, the underrun handling is
  enabled as default now for the new PA, while it's still disabled for
  older PA.  -- tiwai ]

Signed-off-by: David Henningsson <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 pulse/pcm_pulse.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index d6c6792..b0e52ab 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -42,6 +42,7 @@ typedef struct snd_pcm_pulse {
        int handle_underrun;
 
        size_t offset;
+       int64_t written;
 
        pa_stream *stream;
 
@@ -460,6 +461,7 @@ static snd_pcm_sframes_t pulse_write(snd_pcm_ioplug_t * io,
 
        /* Make sure the buffer pointer is in sync */
        pcm->last_size -= writebytes;
+       pcm->written += writebytes;
        ret = update_ptr(pcm);
        if (ret < 0)
                goto finish;
@@ -585,6 +587,15 @@ static void stream_request_cb(pa_stream * p, size_t 
length, void *userdata)
        update_active(pcm);
 }
 
+#if defined(PA_CHECK_VERSION) && PA_CHECK_VERSION(0,99,0)
+#define DEFAULT_HANDLE_UNDERRUN                1
+#define do_underrun_detect(pcm, p) \
+       ((pcm)->written <= pa_stream_get_underflow_index(p))
+#else
+#define DEFAULT_HANDLE_UNDERRUN                0
+#define do_underrun_detect(pcm, p)     1       /* always true */
+#endif
+
 static void stream_underrun_cb(pa_stream * p, void *userdata)
 {
        snd_pcm_pulse_t *pcm = userdata;
@@ -594,7 +605,8 @@ static void stream_underrun_cb(pa_stream * p, void 
*userdata)
        if (!pcm->p)
                return;
 
-       pcm->underrun = 1;
+       if (do_underrun_detect(pcm, p))
+               pcm->underrun = 1;
 }
 
 static void stream_latency_cb(pa_stream *p, void *userdata) {
@@ -739,6 +751,7 @@ static int pulse_prepare(snd_pcm_ioplug_t * io)
 
        pcm->offset = 0;
        pcm->underrun = 0;
+       pcm->written = 0;
 
        /* Reset fake ringbuffer */
        pcm->last_size = 0;
@@ -983,7 +996,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
        const char *server = NULL;
        const char *device = NULL;
        const char *fallback_name = NULL;
-       int handle_underrun = 0;
+       int handle_underrun = DEFAULT_HANDLE_UNDERRUN;
        int err;
        snd_pcm_pulse_t *pcm;
 
-- 
1.7.6.1

++++++ 0007-pulse-Define-a-dummy-PA_CHECK_VERSION-when-not-avail.patch ++++++
>From 83d5f81b7fb873dfe603356ee5b97b1381a4d5ec Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 26 Aug 2011 09:43:11 +0200
Subject: [PATCH] pulse - Define a dummy PA_CHECK_VERSION() when not available

An old version of PA doesn't define this macro, and gives a build error.

Signed-off-by: Takashi Iwai <[email protected]>
---
 pulse/pcm_pulse.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index b0e52ab..e0fbd4c 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -587,7 +587,11 @@ static void stream_request_cb(pa_stream * p, size_t 
length, void *userdata)
        update_active(pcm);
 }
 
-#if defined(PA_CHECK_VERSION) && PA_CHECK_VERSION(0,99,0)
+#ifndef PA_CHECK_VERSION
+#define PA_CHECK_VERSION(x, y, z)      0
+#endif
+
+#if PA_CHECK_VERSION(0,99,0)
 #define DEFAULT_HANDLE_UNDERRUN                1
 #define do_underrun_detect(pcm, p) \
        ((pcm)->written <= pa_stream_get_underflow_index(p))
-- 
1.7.6.1


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to