pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox PR pkg/51954: avoid destroying an uninitia...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33d89b989f29
branches:  trunk
changeset: 358172:33d89b989f29
user:      martin <martin%pkgsrc.org@localhost>
date:      Mon Feb 06 19:00:44 2017 +0000

description:
PR pkg/51954: avoid destroying an uninitialized cond var.
Bump to nb1.

diffstat:

 www/firefox/Makefile                                       |   3 +-
 www/firefox/distinfo                                       |   4 +-
 www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c |  77 ++++++++-----
 3 files changed, 50 insertions(+), 34 deletions(-)

diffs (truncated from 321 to 300 lines):

diff -r 8216715f8b59 -r 33d89b989f29 www/firefox/Makefile
--- a/www/firefox/Makefile      Mon Feb 06 15:55:49 2017 +0000
+++ b/www/firefox/Makefile      Mon Feb 06 19:00:44 2017 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.282 2017/02/06 13:56:04 wiz Exp $
+# $NetBSD: Makefile,v 1.283 2017/02/06 19:00:44 martin Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            51.0
 MOZ_BRANCH_MINOR=      .1
+PKGREVISION=           1
 
 DISTNAME=      firefox-${FIREFOX_VER}.source
 PKGNAME=       firefox-${MOZ_BRANCH}${MOZ_BRANCH_MINOR:S/b/beta/:S/esr//}
diff -r 8216715f8b59 -r 33d89b989f29 www/firefox/distinfo
--- a/www/firefox/distinfo      Mon Feb 06 15:55:49 2017 +0000
+++ b/www/firefox/distinfo      Mon Feb 06 19:00:44 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.270 2017/02/05 15:41:58 martin Exp $
+$NetBSD: distinfo,v 1.271 2017/02/06 19:00:44 martin Exp $
 
 SHA1 (firefox-51.0.1.source.tar.xz) = b73255fd4f90fd0c1b107b566679da2df3f31cf1
 RMD160 (firefox-51.0.1.source.tar.xz) = 6acc6fc8e3e317842d75b0233a24b0f19c9d3f34
@@ -77,7 +77,7 @@
 SHA1 (patch-js_xpconnect_src_xpcprivate.h) = e09e37819961bae40a9f276ae1ee510d2956c23e
 SHA1 (patch-layout_style_GenerateCSSPropsGenerated.py) = 6e2267d2ffda97923e6e39ed2517f86fb7316b86
 SHA1 (patch-media_libcubeb_src_cubeb.c) = 91eb24595c423b7e086670bb67e73cfd0bfb5559
-SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 4c5bb4b095048fb34695f04a052f8fee0c8a44ed
+SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 12e0a63540d9a08394bbedfb46c4db3c89618357
 SHA1 (patch-media_libcubeb_src_cubeb__oss.c) = e15cc2d0c220738ccfd57f79eec242095c8ea536
 SHA1 (patch-media_libcubeb_src_moz.build) = 2b6d7e3bb265220decf9629b1d4b980cadb363fb
 SHA1 (patch-media_libcubeb_tests_moz.build) = 63d8b749a6ebbe8fd662ce1e2bde6aa9cb0b807d
diff -r 8216715f8b59 -r 33d89b989f29 www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c
--- a/www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c        Mon Feb 06 15:55:49 2017 +0000
+++ b/www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c        Mon Feb 06 19:00:44 2017 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-media_libcubeb_src_cubeb__alsa.c,v 1.18 2017/01/25 13:24:51 ryoon Exp $
+$NetBSD: patch-media_libcubeb_src_cubeb__alsa.c,v 1.19 2017/02/06 19:00:44 martin Exp $
 
 * Support alsa audio under NetBSD
+* Avoid https://github.com/kinetiknz/cubeb/issues/226
 
 --- media/libcubeb/src/cubeb_alsa.c.orig       2016-10-31 20:15:39.000000000 +0000
 +++ media/libcubeb/src/cubeb_alsa.c
@@ -71,7 +72,7 @@
  /* ALSA is not thread-safe.  snd_pcm_t instances are individually protected
     by the owning cubeb_stream's mutex.  snd_pcm_t creation and destruction
     is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1),
-@@ -65,6 +113,8 @@ struct cubeb {
+@@ -65,6 +113,8 @@
       workaround is not required. */
    snd_config_t * local_config;
    int is_pa;
@@ -80,7 +81,7 @@
  };
  
  enum stream_state {
-@@ -260,10 +310,10 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -260,10 +310,10 @@
  
    pthread_mutex_lock(&stm->mutex);
  
@@ -94,7 +95,7 @@
    }
  
    /* Failed to recover from an xrun, this stream must be broken. */
-@@ -286,7 +336,7 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -286,7 +336,7 @@
      return RUNNING;
    }
  
@@ -103,7 +104,7 @@
    assert(p);
  
    pthread_mutex_unlock(&stm->mutex);
-@@ -312,10 +362,10 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -312,10 +362,10 @@
          b[i] *= stm->volume;
        }
      }
@@ -117,7 +118,7 @@
      }
      assert(wrote >= 0 && wrote == got);
      stm->write_position += wrote;
-@@ -327,7 +377,7 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -327,7 +377,7 @@
  
      /* Fill the remaining buffer with silence to guarantee one full period
         has been written. */
@@ -126,7 +127,7 @@
  
      set_timeout(&stm->drain_timeout, buffer_time * 1000);
  
-@@ -440,26 +490,26 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -440,26 +490,26 @@
  
    slave_def = NULL;
  
@@ -158,7 +159,7 @@
      if (r < 0) {
        break;
      }
-@@ -468,7 +518,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -468,7 +518,7 @@
      if (r < 0 || r > (int) sizeof(node_name)) {
        break;
      }
@@ -167,7 +168,7 @@
      if (r < 0) {
        break;
      }
-@@ -477,7 +527,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -477,7 +527,7 @@
    } while (0);
  
    if (slave_def) {
@@ -176,7 +177,7 @@
    }
  
    return NULL;
-@@ -500,22 +550,22 @@ init_local_config_with_workaround(char c
+@@ -500,22 +550,22 @@
  
    lconf = NULL;
  
@@ -203,7 +204,7 @@
      if (r < 0) {
        break;
      }
-@@ -524,7 +574,7 @@ init_local_config_with_workaround(char c
+@@ -524,7 +574,7 @@
      if (r < 0 || r > (int) sizeof(node_name)) {
        break;
      }
@@ -212,7 +213,7 @@
      if (r < 0) {
        break;
      }
-@@ -535,12 +585,12 @@ init_local_config_with_workaround(char c
+@@ -535,12 +585,12 @@
      }
  
      /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
@@ -227,7 +228,7 @@
      if (r < 0) {
        break;
      }
-@@ -551,18 +601,18 @@ init_local_config_with_workaround(char c
+@@ -551,18 +601,18 @@
  
      /* Don't clobber an explicit existing handle_underrun value, set it only
         if it doesn't already exist. */
@@ -249,7 +250,7 @@
      if (r < 0) {
        break;
      }
-@@ -570,7 +620,7 @@ init_local_config_with_workaround(char c
+@@ -570,7 +620,7 @@
      return lconf;
    } while (0);
  
@@ -258,7 +259,7 @@
  
    return NULL;
  }
-@@ -582,9 +632,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, s
+@@ -582,9 +632,9 @@
  
    pthread_mutex_lock(&cubeb_alsa_mutex);
    if (local_config) {
@@ -270,7 +271,7 @@
    }
    pthread_mutex_unlock(&cubeb_alsa_mutex);
  
-@@ -597,7 +647,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
+@@ -597,7 +647,7 @@
    int r;
  
    pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -279,7 +280,7 @@
    pthread_mutex_unlock(&cubeb_alsa_mutex);
  
    return r;
-@@ -654,12 +704,65 @@ alsa_init(cubeb ** context, char const *
+@@ -654,12 +704,65 @@
    pthread_attr_t attr;
    snd_pcm_t * dummy;
  
@@ -346,7 +347,7 @@
      cubeb_alsa_error_handler_set = 1;
    }
    pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -667,6 +770,8 @@ alsa_init(cubeb ** context, char const *
+@@ -667,6 +770,8 @@
    ctx = calloc(1, sizeof(*ctx));
    assert(ctx);
  
@@ -355,7 +356,7 @@
    ctx->ops = &alsa_ops;
  
    r = pthread_mutex_init(&ctx->mutex, NULL);
-@@ -716,7 +821,7 @@ alsa_init(cubeb ** context, char const *
+@@ -716,7 +821,7 @@
         config fails with EINVAL, the PA PCM is too old for this workaround. */
      if (r == -EINVAL) {
        pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -364,7 +365,7 @@
        pthread_mutex_unlock(&cubeb_alsa_mutex);
        ctx->local_config = NULL;
      } else if (r >= 0) {
-@@ -755,9 +860,13 @@ alsa_destroy(cubeb * ctx)
+@@ -755,9 +860,13 @@
    pthread_mutex_destroy(&ctx->mutex);
    free(ctx->fds);
  
@@ -379,7 +380,16 @@
      pthread_mutex_unlock(&cubeb_alsa_mutex);
    }
  
-@@ -842,7 +951,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+@@ -836,13 +945,16 @@
+   r = pthread_mutex_init(&stm->mutex, NULL);
+   assert(r == 0);
+ 
++  r = pthread_cond_init(&stm->cond, NULL);
++  assert(r == 0);
++
+   r = alsa_locked_pcm_open(&stm->pcm, SND_PCM_STREAM_PLAYBACK, ctx->local_config);
+   if (r < 0) {
+     alsa_stream_destroy(stm);
      return CUBEB_ERROR;
    }
  
@@ -388,7 +398,7 @@
    assert(r == 0);
  
    latency_us = latency_frames * 1e6 / stm->params.rate;
-@@ -855,7 +964,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+@@ -855,7 +967,7 @@
      latency_us = latency_us < min_latency ? min_latency: latency_us;
    }
  
@@ -397,7 +407,7 @@
                           stm->params.channels, stm->params.rate, 1,
                           latency_us);
    if (r < 0) {
-@@ -863,15 +972,15 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+@@ -863,20 +975,17 @@
      return CUBEB_ERROR_INVALID_FORMAT;
    }
  
@@ -415,8 +425,13 @@
 +  r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
    assert((nfds_t) r == stm->nfds);
  
-   r = pthread_cond_init(&stm->cond, NULL);
-@@ -902,7 +1011,7 @@ alsa_stream_destroy(cubeb_stream * stm)
+-  r = pthread_cond_init(&stm->cond, NULL);
+-  assert(r == 0);
+-
+   if (alsa_register_stream(ctx, stm) != 0) {
+     alsa_stream_destroy(stm);
+     return CUBEB_ERROR;
+@@ -902,7 +1011,7 @@
    pthread_mutex_lock(&stm->mutex);
    if (stm->pcm) {
      if (stm->state == DRAINING) {
@@ -425,7 +440,7 @@
      }
      alsa_locked_pcm_close(stm->pcm);
      stm->pcm = NULL;
-@@ -944,12 +1053,12 @@ alsa_get_max_channel_count(cubeb * ctx, 
+@@ -944,12 +1053,12 @@
      return CUBEB_ERROR;
    }
  
@@ -440,7 +455,7 @@
    if (r < 0) {
      return CUBEB_ERROR;
    }
-@@ -969,34 +1078,34 @@ alsa_get_preferred_sample_rate(cubeb * c
+@@ -969,34 +1078,34 @@
  
    /* get a pcm, disabling resampling, so we get a rate the
     * hardware/dmix/pulse/etc. supports. */
@@ -483,7 +498,7 @@
  
    return CUBEB_OK;
  }
-@@ -1020,7 +1129,7 @@ alsa_stream_start(cubeb_stream * stm)
+@@ -1020,7 +1129,7 @@
    ctx = stm->context;
  
    pthread_mutex_lock(&stm->mutex);
@@ -492,7 +507,7 @@
    gettimeofday(&stm->last_activity, NULL);
    pthread_mutex_unlock(&stm->mutex);
  
-@@ -1054,7 +1163,7 @@ alsa_stream_stop(cubeb_stream * stm)
+@@ -1054,7 +1163,7 @@



Home | Main Index | Thread Index | Old Index