pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/www/firefox Fix build with alsa option on NetBSD. PR/...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9cfcdc69101d
branches: trunk
changeset: 364592:9cfcdc69101d
user: tsutsui <tsutsui%pkgsrc.org@localhost>
date: Fri Jun 30 16:45:05 2017 +0000
description:
Fix build with alsa option on NetBSD. PR/52310
diffstat:
www/firefox/distinfo | 4 +-
www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c | 75 +++++++------
2 files changed, 42 insertions(+), 37 deletions(-)
diffs (truncated from 337 to 300 lines):
diff -r b18696b38545 -r 9cfcdc69101d www/firefox/distinfo
--- a/www/firefox/distinfo Fri Jun 30 16:36:18 2017 +0000
+++ b/www/firefox/distinfo Fri Jun 30 16:45:05 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.284 2017/06/30 16:36:18 tsutsui Exp $
+$NetBSD: distinfo,v 1.285 2017/06/30 16:45:05 tsutsui Exp $
SHA1 (firefox-54.0.source.tar.xz) = 44e40c77f58e3b203dc60f51c5a02993f6c38ee5
RMD160 (firefox-54.0.source.tar.xz) = 310f21498bc69939049d3ca881674a40fba8da21
@@ -60,7 +60,7 @@
SHA1 (patch-js_xpconnect_src_xpcprivate.h) = e09e37819961bae40a9f276ae1ee510d2956c23e
SHA1 (patch-media_libcubeb_gtest_moz.build) = ebb4be6e6bca4a0ed6858516ec9fdb7828bbe2e1
SHA1 (patch-media_libcubeb_src_cubeb.c) = c689537aa7c3c40758d4b74e471e4dad1adeef5d
-SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = bbd8796faaee52d9721bc406fb0a413b66ad9bc9
+SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 8c99af543c49c23fea102c4ad9ffd617cc90631e
SHA1 (patch-media_libcubeb_src_cubeb__oss.c) = 88cdfb9b9aa8c2607ca79bfa7fce4353e65638f7
SHA1 (patch-media_libcubeb_src_moz.build) = 59a2f95300b26c8047532c80445b958e7b8e738c
SHA1 (patch-media_libcubeb_update.sh) = 7bd5145466c2af086a501be4e77432c0857236ce
diff -r b18696b38545 -r 9cfcdc69101d www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c
--- a/www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c Fri Jun 30 16:36:18 2017 +0000
+++ b/www/firefox/patches/patch-media_libcubeb_src_cubeb__alsa.c Fri Jun 30 16:45:05 2017 +0000
@@ -1,11 +1,16 @@
-$NetBSD: patch-media_libcubeb_src_cubeb__alsa.c,v 1.22 2017/06/14 11:28:44 ryoon Exp $
+$NetBSD: patch-media_libcubeb_src_cubeb__alsa.c,v 1.23 2017/06/30 16:45:05 tsutsui Exp $
* Support alsa audio under NetBSD
* Avoid https://github.com/kinetiknz/cubeb/issues/226
--- media/libcubeb/src/cubeb_alsa.c.orig 2017-06-05 20:45:14.000000000 +0000
+++ media/libcubeb/src/cubeb_alsa.c
-@@ -12,6 +12,7 @@
+@@ -8,10 +8,12 @@
+ #define _DEFAULT_SOURCE
+ #define _BSD_SOURCE
+ #define _XOPEN_SOURCE 500
++#define _NETBSD_SOURCE
+ #include <pthread.h>
#include <sys/time.h>
#include <assert.h>
#include <limits.h>
@@ -13,7 +18,7 @@
#include <poll.h>
#include <unistd.h>
#include <alsa/asoundlib.h>
-@@ -25,6 +26,52 @@
+@@ -25,6 +27,52 @@
#define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin"
@@ -66,7 +71,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 +112,8 @@ struct cubeb {
+@@ -65,6 +113,8 @@ struct cubeb {
workaround is not required. */
snd_config_t * local_config;
int is_pa;
@@ -75,7 +80,7 @@
};
enum stream_state {
-@@ -243,8 +292,8 @@ set_timeout(struct timeval * timeout, un
+@@ -243,8 +293,8 @@ set_timeout(struct timeval * timeout, un
static void
stream_buffer_decrement(cubeb_stream * stm, long count)
{
@@ -86,7 +91,7 @@
stm->bufframes -= count;
}
-@@ -276,9 +325,9 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -276,9 +326,9 @@ alsa_process_stream(cubeb_stream * stm)
/* Call _poll_descriptors_revents() even if we don't use it
to let underlying plugins clear null events. Otherwise poll()
may wake up again and again, producing unnecessary CPU usage. */
@@ -98,7 +103,7 @@
/* Got null event? Bail and wait for another wakeup. */
if (avail == 0) {
-@@ -301,7 +350,7 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -301,7 +351,7 @@ alsa_process_stream(cubeb_stream * stm)
// TODO: should it be marked as DRAINING?
}
@@ -107,7 +112,7 @@
if (got < 0) {
avail = got; // the error handler below will recover us
-@@ -345,7 +394,7 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -345,7 +395,7 @@ alsa_process_stream(cubeb_stream * stm)
(!stm->other_stream || stm->other_stream->bufframes > 0)) {
long got = avail - stm->bufframes;
void * other_buffer = stm->other_stream ? stm->other_stream->buffer : NULL;
@@ -116,7 +121,7 @@
/* Correct read size to the other stream available frames */
if (stm->other_stream && got > (snd_pcm_sframes_t) stm->other_stream->bufframes) {
-@@ -372,8 +421,8 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -372,8 +422,8 @@ alsa_process_stream(cubeb_stream * stm)
long drain_frames = avail - stm->bufframes;
double drain_time = (double) drain_frames / stm->params.rate;
@@ -127,7 +132,7 @@
stm->bufframes = avail;
/* Mark as draining, unless we're waiting for capture */
-@@ -400,7 +449,7 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -400,7 +450,7 @@ alsa_process_stream(cubeb_stream * stm)
}
}
@@ -136,7 +141,7 @@
if (wrote < 0) {
avail = wrote; // the error handler below will recover us
} else {
-@@ -413,13 +462,13 @@ alsa_process_stream(cubeb_stream * stm)
+@@ -413,13 +463,13 @@ alsa_process_stream(cubeb_stream * stm)
/* Got some error? Let's try to recover the stream. */
if (avail < 0) {
@@ -153,7 +158,7 @@
}
}
-@@ -535,26 +584,26 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -535,26 +585,26 @@ get_slave_pcm_node(snd_config_t * lconf,
slave_def = NULL;
@@ -185,7 +190,7 @@
if (r < 0) {
break;
}
-@@ -563,7 +612,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -563,7 +613,7 @@ get_slave_pcm_node(snd_config_t * lconf,
if (r < 0 || r > (int) sizeof(node_name)) {
break;
}
@@ -194,7 +199,7 @@
if (r < 0) {
break;
}
-@@ -572,7 +621,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -572,7 +622,7 @@ get_slave_pcm_node(snd_config_t * lconf,
} while (0);
if (slave_def) {
@@ -203,7 +208,7 @@
}
return NULL;
-@@ -595,22 +644,22 @@ init_local_config_with_workaround(char c
+@@ -595,22 +645,22 @@ init_local_config_with_workaround(char c
lconf = NULL;
@@ -230,7 +235,7 @@
if (r < 0) {
break;
}
-@@ -619,7 +668,7 @@ init_local_config_with_workaround(char c
+@@ -619,7 +669,7 @@ init_local_config_with_workaround(char c
if (r < 0 || r > (int) sizeof(node_name)) {
break;
}
@@ -239,7 +244,7 @@
if (r < 0) {
break;
}
-@@ -630,12 +679,12 @@ init_local_config_with_workaround(char c
+@@ -630,12 +680,12 @@ init_local_config_with_workaround(char c
}
/* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
@@ -254,7 +259,7 @@
if (r < 0) {
break;
}
-@@ -646,18 +695,18 @@ init_local_config_with_workaround(char c
+@@ -646,18 +696,18 @@ init_local_config_with_workaround(char c
/* Don't clobber an explicit existing handle_underrun value, set it only
if it doesn't already exist. */
@@ -276,7 +281,7 @@
if (r < 0) {
break;
}
-@@ -665,7 +714,7 @@ init_local_config_with_workaround(char c
+@@ -665,7 +715,7 @@ init_local_config_with_workaround(char c
return lconf;
} while (0);
@@ -285,7 +290,7 @@
return NULL;
}
-@@ -677,9 +726,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, c
+@@ -677,9 +727,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, c
pthread_mutex_lock(&cubeb_alsa_mutex);
if (local_config) {
@@ -297,7 +302,7 @@
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -692,7 +741,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
+@@ -692,7 +742,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
int r;
pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -306,7 +311,7 @@
pthread_mutex_unlock(&cubeb_alsa_mutex);
return r;
-@@ -755,12 +804,65 @@ alsa_init(cubeb ** context, char const *
+@@ -755,12 +805,65 @@ alsa_init(cubeb ** context, char const *
pthread_attr_t attr;
snd_pcm_t * dummy;
@@ -373,7 +378,7 @@
cubeb_alsa_error_handler_set = 1;
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -768,6 +870,8 @@ alsa_init(cubeb ** context, char const *
+@@ -768,6 +871,8 @@ alsa_init(cubeb ** context, char const *
ctx = calloc(1, sizeof(*ctx));
assert(ctx);
@@ -382,7 +387,7 @@
ctx->ops = &alsa_ops;
r = pthread_mutex_init(&ctx->mutex, NULL);
-@@ -817,7 +921,7 @@ alsa_init(cubeb ** context, char const *
+@@ -817,7 +922,7 @@ alsa_init(cubeb ** context, char const *
config fails with EINVAL, the PA PCM is too old for this workaround. */
if (r == -EINVAL) {
pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -391,7 +396,7 @@
pthread_mutex_unlock(&cubeb_alsa_mutex);
ctx->local_config = NULL;
} else if (r >= 0) {
-@@ -857,9 +961,13 @@ alsa_destroy(cubeb * ctx)
+@@ -857,9 +962,13 @@ alsa_destroy(cubeb * ctx)
pthread_mutex_destroy(&ctx->mutex);
free(ctx->fds);
@@ -406,7 +411,7 @@
pthread_mutex_unlock(&cubeb_alsa_mutex);
}
-@@ -942,7 +1050,7 @@ alsa_stream_init_single(cubeb * ctx, cub
+@@ -942,7 +1051,7 @@ alsa_stream_init_single(cubeb * ctx, cub
return CUBEB_ERROR;
}
@@ -415,7 +420,7 @@
assert(r == 0);
latency_us = latency_frames * 1e6 / stm->params.rate;
-@@ -955,7 +1063,7 @@ alsa_stream_init_single(cubeb * ctx, cub
+@@ -955,7 +1064,7 @@ alsa_stream_init_single(cubeb * ctx, cub
latency_us = latency_us < min_latency ? min_latency: latency_us;
}
@@ -424,7 +429,7 @@
stm->params.channels, stm->params.rate, 1,
latency_us);
if (r < 0) {
-@@ -963,20 +1071,20 @@ alsa_stream_init_single(cubeb * ctx, cub
+@@ -963,20 +1072,20 @@ alsa_stream_init_single(cubeb * ctx, cub
return CUBEB_ERROR_INVALID_FORMAT;
}
@@ -449,7 +454,7 @@
assert((nfds_t) r == stm->nfds);
if (alsa_register_stream(ctx, stm) != 0) {
-@@ -1048,7 +1156,7 @@ alsa_stream_destroy(cubeb_stream * stm)
+@@ -1048,7 +1157,7 @@ alsa_stream_destroy(cubeb_stream * stm)
pthread_mutex_lock(&stm->mutex);
if (stm->pcm) {
if (stm->state == DRAINING) {
@@ -458,7 +463,7 @@
}
alsa_locked_pcm_close(stm->pcm);
stm->pcm = NULL;
-@@ -1094,12 +1202,12 @@ alsa_get_max_channel_count(cubeb * ctx,
+@@ -1094,12 +1203,12 @@ alsa_get_max_channel_count(cubeb * ctx,
assert(stm);
@@ -473,7 +478,7 @@
if (r < 0) {
return CUBEB_ERROR;
}
-@@ -1120,34 +1228,34 @@ alsa_get_preferred_sample_rate(cubeb * c
+@@ -1120,34 +1229,34 @@ alsa_get_preferred_sample_rate(cubeb * c
/* get a pcm, disabling resampling, so we get a rate the
Home |
Main Index |
Thread Index |
Old Index