pkgsrc-Changes archive

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

CVS commit: pkgsrc/multimedia/handbrake



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Thu Feb 13 23:12:37 UTC 2020

Modified Files:
        pkgsrc/multimedia/handbrake: Makefile distinfo
        pkgsrc/multimedia/handbrake/patches:
            patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch

Log Message:
handbrake: Use pthread properly and fix segfault in correct way

* Bump PKGREVISION.
* From multimedia/libbluray by kamil@.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 pkgsrc/multimedia/handbrake/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/multimedia/handbrake/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/multimedia/handbrake/Makefile
diff -u pkgsrc/multimedia/handbrake/Makefile:1.55 pkgsrc/multimedia/handbrake/Makefile:1.56
--- pkgsrc/multimedia/handbrake/Makefile:1.55   Wed Feb 12 13:54:56 2020
+++ pkgsrc/multimedia/handbrake/Makefile        Thu Feb 13 23:12:37 2020
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.55 2020/02/12 13:54:56 ryoon Exp $
+# $NetBSD: Makefile,v 1.56 2020/02/13 23:12:37 ryoon Exp $
 #
 
 DISTNAME=      HandBrake-1.3.1-source
 PKGNAME=       ${DISTNAME:tl:S/-source//}
+PKGREVISION=   1
 CATEGORIES=    multimedia
 MASTER_SITES=  https://download.handbrake.fr/releases/${PKGVERSION_NOREV}/
 EXTRACT_SUFX=  .tar.bz2

Index: pkgsrc/multimedia/handbrake/distinfo
diff -u pkgsrc/multimedia/handbrake/distinfo:1.8 pkgsrc/multimedia/handbrake/distinfo:1.9
--- pkgsrc/multimedia/handbrake/distinfo:1.8    Wed Feb 12 13:54:56 2020
+++ pkgsrc/multimedia/handbrake/distinfo        Thu Feb 13 23:12:37 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2020/02/12 13:54:56 ryoon Exp $
+$NetBSD: distinfo,v 1.9 2020/02/13 23:12:37 ryoon Exp $
 
 SHA1 (handbrake/HandBrake-1.3.1-source.tar.bz2) = 213da9cebb19215d6e7ea49ac390ecc9cb6c749f
 RMD160 (handbrake/HandBrake-1.3.1-source.tar.bz2) = 2e586c8dae9d4a8b7c2fcb036fcdbff62f5c26d6
@@ -28,5 +28,5 @@ SHA1 (handbrake/x265_3.2.1.tar.gz) = 0bd
 RMD160 (handbrake/x265_3.2.1.tar.gz) = 7386c00a49a2fc143cd3c8cea657872235a8ba77
 SHA512 (handbrake/x265_3.2.1.tar.gz) = 5cb29b9d4475c1f686f6e31e47ccddde3db1639d5dcf9c058513389a9fdeb35a83b14e30e59498a76dec74bb0b410b6d8f5b1b45d18927be9811bb6a40d8d568
 Size (handbrake/x265_3.2.1.tar.gz) = 1426255 bytes
-SHA1 (patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch) = c3ecbaa85bfc23021fd8474774a710f1e9068a18
+SHA1 (patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch) = 8538213d147d2bb9bec455408147bd7bd40df8c2
 SHA1 (patch-libhb_fifo.c) = 46c5ec1f2c665da297830c326e703160e3e911d2

Index: pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch
diff -u pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch:1.1 
pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch:1.2
--- pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch:1.1       Wed Feb 12 13:54:56 2020
+++ pkgsrc/multimedia/handbrake/patches/patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch   Thu Feb 13 23:12:37 2020
@@ -1,27 +1,96 @@
-$NetBSD: patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch,v 1.1 2020/02/12 13:54:56 ryoon Exp $
+$NetBSD: patch-contrib_libbluray_P04-netbsd-pthread__equal-check.patch,v 1.2 2020/02/13 23:12:37 ryoon Exp $
 
-* Fix segafult on recent NetBSD-current.
+* mutex: Switch the POSIX backend to PTHREAD_MUTEX_RECURSIVE
+  https://code.videolan.org/videolan/libbluray/merge_requests/17
+  via multimedia/libbluray
 
---- contrib/libbluray/P04-netbsd-pthread_equal-check.patch.orig        2020-02-11 08:09:40.072157575 +0000
+--- contrib/libbluray/P04-netbsd-pthread_equal-check.patch.orig        2020-02-13 18:46:05.315624115 +0000
 +++ contrib/libbluray/P04-netbsd-pthread_equal-check.patch
-@@ -0,0 +1,20 @@
-+--- libbluray/src/util/mutex.c.orig   2019-06-07 18:00:28.000000000 +0000
-++++ libbluray/src/util/mutex.c
-+@@ -89,7 +89,7 @@ static int _mutex_init(MUTEX_IMPL *p)
+@@ -0,0 +1,87 @@
++--- libbluray-1.1.2/src/util/mutex.c.orig     2019-06-07 18:00:28.000000000 +0000
+++++ libbluray-1.2.2/src/util/mutex.c
++@@ -68,18 +68,16 @@ static int _mutex_destroy(MUTEX_IMPL *p)
++ 
++ #elif defined(HAVE_PTHREAD_H)
++ 
++-typedef struct {
++-    int             lock_count;
++-    pthread_t       owner;
++-    pthread_mutex_t mutex;
++-} MUTEX_IMPL;
+++typedef pthread_mutex_t MUTEX_IMPL;
++ 
++ static int _mutex_init(MUTEX_IMPL *p)
++ {
++-    p->owner      = (pthread_t)-1;
++-    p->lock_count = 0;
+++    pthread_mutexattr_t attr;
++ 
++-    if (pthread_mutex_init(&p->mutex, NULL)) {
+++    pthread_mutexattr_init(&attr);
+++    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+++
+++    if (pthread_mutex_init(p, &attr)) {
++         BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_init() failed !\n");
++         return -1;
++     }
++@@ -89,40 +87,17 @@ static int _mutex_init(MUTEX_IMPL *p)
 + 
 + static int _mutex_lock(MUTEX_IMPL *p)
 + {
 +-    if (pthread_equal(p->owner, pthread_self())) {
-++    if (p->owner == pthread_self()) {
-+         /* recursive lock */
-+         p->lock_count++;
-+         return 0;
-+@@ -108,7 +108,7 @@ static int _mutex_lock(MUTEX_IMPL *p)
++-        /* recursive lock */
++-        p->lock_count++;
++-        return 0;
++-    }
++-
++-    if (pthread_mutex_lock(&p->mutex)) {
+++    if (pthread_mutex_lock(p)) {
++         BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_lock() failed !\n");
++         return -1;
++     }
++ 
++-    p->owner      = pthread_self();
++-    p->lock_count = 1;
++-
++     return 0;
++ }
 + 
 + static int _mutex_unlock(MUTEX_IMPL *p)
 + {
 +-    if (!pthread_equal(p->owner, pthread_self())) {
-++    if (!(p->owner == pthread_self())) {
-+         BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock(): not owner !\n");
++-        BD_DEBUG(DBG_BLURAY|DBG_CRIT, "bd_mutex_unlock(): not owner !\n");
++-        return -1;
++-    }
++-
++-    p->lock_count--;
++-    if (p->lock_count > 0) {
++-        return 0;
++-    }
++-
++-    /* unlock */
++-
++-    p->owner = (pthread_t)-1;
++-
++-    if (pthread_mutex_unlock(&p->mutex)) {
+++    if (pthread_mutex_unlock(p)) {
++         BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_unlock() failed !\n");
++         return -1;
++     }
++@@ -132,10 +107,7 @@ static int _mutex_unlock(MUTEX_IMPL *p)
++ 
++ static int _mutex_destroy(MUTEX_IMPL *p)
++ {
++-    _mutex_lock(p);
++-    _mutex_unlock(p);
++-
++-    if (pthread_mutex_destroy(&p->mutex)) {
+++    if (pthread_mutex_destroy(p)) {
++         BD_DEBUG(DBG_BLURAY|DBG_CRIT, "pthread_mutex_destroy() failed !\n");
 +         return -1;
 +     }
++@@ -193,4 +165,3 @@ int bd_mutex_destroy(BD_MUTEX *p)
++     X_FREE(p->impl);
++     return 0;
++ }
++-



Home | Main Index | Thread Index | Old Index