[pulseaudio-commits] 2 commits - src/pulsecore

Colin Guthrie colin at kemper.freedesktop.org
Wed Mar 28 03:33:23 PDT 2012


 src/pulsecore/core-util.c |   21 ++++++++++++++++-----
 src/pulsecore/resampler.c |   11 +----------
 2 files changed, 17 insertions(+), 15 deletions(-)

New commits:
commit 8ea6b0585e802490d160814b61d0165b875e0a84
Author: Colin Guthrie <colin at mageia.org>
Date:   Fri Mar 23 09:24:48 2012 +0000

    Revert "resamplers: Optimize trivial resampler"
    
    This causes problems with 24kHz audio (results in echoing)
    when upscaling to 44.1kHz or 48kHz.
    
    It can be reapplied when the optimisation works for all cases.
    
    This reverts commit 8539fe9765e5713f9863ab15d0c5b42189f98ae2.

diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 6676943..9a651f4 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1436,16 +1436,7 @@ static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned
 
         pa_assert_fp(o_index * fz < pa_memblock_get_length(output->memblock));
 
-        /* Directly assign some common sample sizes, use memcpy as fallback */
-        if (r->w_sz == 2) {
-            for (unsigned c = 0; c < r->o_ss.channels; c++)
-                ((uint16_t *) dst)[o_index+c] = ((uint16_t *) src)[i_index+c];
-        } else if (r->w_sz == 4) {
-            for (unsigned c = 0; c < r->o_ss.channels; c++)
-                ((uint32_t *) dst)[o_index+c] = ((uint32_t *) src)[i_index+c];
-        } else {
-            memcpy((uint8_t *) dst + fz * o_index, (uint8_t *) src + fz * i_index, (int) fz);
-        }
+        memcpy((uint8_t*) dst + fz * o_index, (uint8_t*) src + fz * i_index, (int) fz);
     }
 
     pa_memblock_release(input->memblock);

commit 664985b7c2fdcc218b4c649f8b52f5047d778659
Author: Colin Guthrie <colin at mageia.org>
Date:   Wed Mar 14 01:41:48 2012 +0000

    core-util: Attempt to make runtime paths smaller to avoid 108 char limit.
    
    When the runtime path gets long (which can happen on some NFS
    mounts where $HOME is not just /home/$USER), it can grow
    longer the 108 char limit imposed by sockaddr_un.sun_path.
    
    This just calls realpath which should ultimately point into
    /tmp in most cases and result in a much smaller path.
    
    Only do this when we are adding on a name component to the
    runtime path so creating the actual symlink will still get
    the original, long name, but this shouldn't be a problem
    as it never goes into the sockaddr_un.sun_path.
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44680

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 1aa5a9a..61f980e 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1980,7 +1980,7 @@ static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
     rtp = rt ? pa_get_runtime_dir() : pa_get_state_dir();
 
     if (fn) {
-        char *r;
+        char *r, *canonical_rtp;
 
         if (pa_is_path_absolute(fn)) {
             pa_xfree(rtp);
@@ -1990,20 +1990,31 @@ static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
         if (!rtp)
             return NULL;
 
+        /* Hopefully make the path smaller to avoid 108 char limit (fdo#44680) */
+        if ((canonical_rtp = pa_realpath(rtp))) {
+            if (strlen(rtp) >= strlen(canonical_rtp))
+                pa_xfree(rtp);
+            else {
+                pa_xfree(canonical_rtp);
+                canonical_rtp = rtp;
+            }
+        } else
+            canonical_rtp = rtp;
+
         if (prependmid) {
             char *mid;
 
             if (!(mid = pa_machine_id())) {
-                pa_xfree(rtp);
+                pa_xfree(canonical_rtp);
                 return NULL;
             }
 
-            r = pa_sprintf_malloc("%s" PA_PATH_SEP "%s-%s", rtp, mid, fn);
+            r = pa_sprintf_malloc("%s" PA_PATH_SEP "%s-%s", canonical_rtp, mid, fn);
             pa_xfree(mid);
         } else
-            r = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", rtp, fn);
+            r = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", canonical_rtp, fn);
 
-        pa_xfree(rtp);
+        pa_xfree(canonical_rtp);
         return r;
     } else
         return rtp;



More information about the pulseaudio-commits mailing list