diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2020-08-30 00:20:45 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2020-08-30 00:20:45 +0000 |
commit | e603b4e4d1a8ef61f6cd86157decc6e7928f9d4d (patch) | |
tree | 44095a56912fffd9e4d64ea79c74ded79e8777d3 /www/firefox-esr/files | |
parent | 7944823eddfdc7128d191329f0e737c7e784cbfc (diff) | |
download | ports-e603b4e4d1a8ef61f6cd86157decc6e7928f9d4d.tar.gz ports-e603b4e4d1a8ef61f6cd86157decc6e7928f9d4d.zip |
Notes
Diffstat (limited to 'www/firefox-esr/files')
-rw-r--r-- | www/firefox-esr/files/patch-cubeb-oss | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/www/firefox-esr/files/patch-cubeb-oss b/www/firefox-esr/files/patch-cubeb-oss index 7a5e46dc338f..a2dd3a22002e 100644 --- a/www/firefox-esr/files/patch-cubeb-oss +++ b/www/firefox-esr/files/patch-cubeb-oss @@ -61,7 +61,7 @@ https://github.com/kinetiknz/cubeb/pull/600 #endif --- /dev/null +++ media/libcubeb/src/cubeb_oss.c -@@ -0,0 +1,1129 @@ +@@ -0,0 +1,1151 @@ +/* + * Copyright © 2019-2020 Nia Alarie <nia@NetBSD.org> + * Copyright © 2020 Ka Ho Ng <khng300@gmail.com> @@ -150,6 +150,7 @@ https://github.com/kinetiknz/cubeb/pull/600 + struct cubeb_ops const * ops; + + /* Our intern string store */ ++ pthread_mutex_t mutex; /* protects devid_strs */ + cubeb_strings *devid_strs; +}; + @@ -184,6 +185,16 @@ https://github.com/kinetiknz/cubeb/pull/600 + unsigned int nfr; /* Number of frames allocated */ +}; + ++static char const * ++oss_cubeb_devid_intern(cubeb *context, char const * devid) ++{ ++ char const *is; ++ pthread_mutex_lock(&context->mutex); ++ is = cubeb_strings_intern(context->devid_strs, devid); ++ pthread_mutex_unlock(&context->mutex); ++ return is; ++} ++ +int +oss_init(cubeb **context, char const *context_name) { + cubeb * c; @@ -192,18 +203,29 @@ https://github.com/kinetiknz/cubeb/pull/600 + if ((c = calloc(1, sizeof(cubeb))) == NULL) { + return CUBEB_ERROR; + } ++ + if (cubeb_strings_init(&c->devid_strs) == CUBEB_ERROR) { -+ free(c); -+ return CUBEB_ERROR; ++ goto fail; + } ++ ++ if (pthread_mutex_init(&c->mutex, NULL) != 0) { ++ goto fail; ++ } ++ + c->ops = &oss_ops; + *context = c; + return CUBEB_OK; ++ ++fail: ++ cubeb_strings_destroy(c->devid_strs); ++ free(c); ++ return CUBEB_ERROR; +} + +static void +oss_destroy(cubeb * context) +{ ++ pthread_mutex_destroy(&context->mutex); + cubeb_strings_destroy(context->devid_strs); + free(context); +} @@ -433,7 +455,7 @@ https://github.com/kinetiknz/cubeb/pull/600 + if (oss_probe_open(sinfo.devname, type, NULL, &ai)) + continue; + -+ devid = cubeb_strings_intern(context->devid_strs, sinfo.devname); ++ devid = oss_cubeb_devid_intern(context, sinfo.devname); + if (devid == NULL) + continue; + @@ -546,7 +568,7 @@ https://github.com/kinetiknz/cubeb/pull/600 + } + cdi.type = type; + -+ devid = cubeb_strings_intern(context->devid_strs, ai.devnode); ++ devid = oss_cubeb_devid_intern(context, ai.devnode); + cdi.device_id = strdup(ai.name); + cdi.friendly_name = strdup(ai.name); + cdi.group_id = strdup(ai.name); @@ -877,7 +899,7 @@ https://github.com/kinetiknz/cubeb/pull/600 + + if ((pfds[0].revents & (POLLERR|POLLHUP)) || + (pfds[1].revents & (POLLERR|POLLHUP))) { -+ LOG("Error occured on playback or record fds", errno); ++ LOG("Error %d occured on playback or record fds", errno); + state = CUBEB_STATE_ERROR; + break; + } |