git: 890355b44b8e - main - multimedia/mlt7*: Update to 7.22.0

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Thu, 07 Dec 2023 00:08:42 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=890355b44b8e73e91af2c7bda5148087f84e4640

commit 890355b44b8e73e91af2c7bda5148087f84e4640
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2023-12-07 00:04:42 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2023-12-07 00:08:31 +0000

    multimedia/mlt7*: Update to 7.22.0
    
    https://github.com/mltframework/mlt/releases/tag/v7.22.0
---
 Mk/Uses/mlt.mk                                     |  2 +-
 multimedia/mlt7-glaxnimate/Makefile                |  1 -
 multimedia/mlt7-qt/Makefile                        |  4 --
 multimedia/mlt7/Makefile                           |  2 -
 multimedia/mlt7/distinfo                           |  6 +--
 multimedia/mlt7/files/patch-CMakeLists.txt         |  4 +-
 ...patch-src_modules_avformat_producer__avformat.c | 54 ++++++++++++++++++++++
 .../files/patch-src_modules_rtaudio_CMakeLists.txt |  4 +-
 .../files/patch-src_modules_rtaudio_RtAudio.cpp    | 22 ---------
 multimedia/mlt7/pkg-plist                          |  1 +
 10 files changed, 63 insertions(+), 37 deletions(-)

diff --git a/Mk/Uses/mlt.mk b/Mk/Uses/mlt.mk
index b2b9378b6949..d81f848e37b9 100644
--- a/Mk/Uses/mlt.mk
+++ b/Mk/Uses/mlt.mk
@@ -37,7 +37,7 @@ _MLT_NODEPEND=	yes
 .  endif
 
 # Library dependencies
-_MLT7_VERSION=	7.20.0
+_MLT7_VERSION=	7.22.0
 _MLT7_PORTNAME=	mlt7
 _MLT7_LIB=	libmlt-7.so
 _MLT7_MELT=	${LOCALBASE}/bin/melt-7
diff --git a/multimedia/mlt7-glaxnimate/Makefile b/multimedia/mlt7-glaxnimate/Makefile
index aa356f376ebd..a09ddbca6ab5 100644
--- a/multimedia/mlt7-glaxnimate/Makefile
+++ b/multimedia/mlt7-glaxnimate/Makefile
@@ -17,7 +17,6 @@ FLAVORS=	qt5 qt6
 FLAVOR?=	qt5
 
 USES=		qt:${FLAVOR:S/qt//} libarchive xorg
-USE_LOCALE=	C.UTF-8
 USE_QT=		${_USE_QT_${FLAVOR}}
 USE_XORG=	x11
 
diff --git a/multimedia/mlt7-qt/Makefile b/multimedia/mlt7-qt/Makefile
index 292cfb7f26a0..2dab919b70e1 100644
--- a/multimedia/mlt7-qt/Makefile
+++ b/multimedia/mlt7-qt/Makefile
@@ -17,13 +17,9 @@ FLAVORS=	qt5 qt6
 FLAVOR?=	qt5
 
 USES=		qt:${FLAVOR:S/qt//} xorg
-USE_CXXSTD=	c++11
-
 USE_QT=		${_USE_QT_${FLAVOR}}
 USE_XORG=	x11
 
-CONFLICTS_INSTALL=	mlt6-qt5
-
 # Flavor handling
 _USE_QT_qt5=	core gui svg widgets xml \
 		buildtools:build qmake:build
diff --git a/multimedia/mlt7/Makefile b/multimedia/mlt7/Makefile
index 3d71406a9346..903c909005c9 100644
--- a/multimedia/mlt7/Makefile
+++ b/multimedia/mlt7/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=		${_MLT_PORTNAME}
 DISTVERSION=		${_MLT_VERSION}
-PORTREVISION?=		2
 CATEGORIES?=		multimedia
 MASTER_SITES=		https://github.com/mltframework/mlt/releases/download/v${DISTVERSION}/
 DISTFILES=		mlt-${DISTVERSION}${EXTRACT_SUFX}
@@ -115,7 +114,6 @@ RESAMPLE_LIB_DEPENDS=	libsamplerate.so:audio/libsamplerate
 RESAMPLE_CMAKE_BOOL=	MOD_RESAMPLE
 
 RTAUDIO_DESC=		Enable RtAudio module
-RTAUDIO_BROKEN=		fails to build with RtAudio 6.0.0, see https://github.com/mltframework/mlt/issues/930
 RTAUDIO_LIB_DEPENDS=	librtaudio.so:audio/rtaudio \
 			libpulse-simple.so:audio/pulseaudio
 RTAUDIO_CMAKE_BOOL=	MOD_RTAUDIO
diff --git a/multimedia/mlt7/distinfo b/multimedia/mlt7/distinfo
index 6328b9abb165..27f24af506e9 100644
--- a/multimedia/mlt7/distinfo
+++ b/multimedia/mlt7/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1696307574
-SHA256 (mlt-7.20.0.tar.gz) = 7472372b31f76b2eb0ac66c756391be7cb859a3a779c97ccb7dcf7086ac9d816
-SIZE (mlt-7.20.0.tar.gz) = 1636493
+TIMESTAMP = 1701896836
+SHA256 (mlt-7.22.0.tar.gz) = 7cf4d9573a061d76902c6e12a2f09f5f461e7c697635233df82a63a3fe4d6da6
+SIZE (mlt-7.22.0.tar.gz) = 1659954
diff --git a/multimedia/mlt7/files/patch-CMakeLists.txt b/multimedia/mlt7/files/patch-CMakeLists.txt
index be0c7f0606c1..372e5cd2de3b 100644
--- a/multimedia/mlt7/files/patch-CMakeLists.txt
+++ b/multimedia/mlt7/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2022-07-07 05:23:41 UTC
+--- CMakeLists.txt.orig	2023-12-06 23:26:22 UTC
 +++ CMakeLists.txt
-@@ -473,9 +473,6 @@ if(UNIX AND NOT APPLE)
+@@ -547,9 +547,6 @@ if(UNIX AND NOT APPLE)
  
  if(UNIX AND NOT APPLE)
    install(FILES docs/melt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME melt-${MLT_VERSION_MAJOR}.1)
diff --git a/multimedia/mlt7/files/patch-src_modules_avformat_producer__avformat.c b/multimedia/mlt7/files/patch-src_modules_avformat_producer__avformat.c
new file mode 100644
index 000000000000..c5a04d3b9915
--- /dev/null
+++ b/multimedia/mlt7/files/patch-src_modules_avformat_producer__avformat.c
@@ -0,0 +1,54 @@
+From 20b9bc778542b105039471e25e192e51fe9fd61f Mon Sep 17 00:00:00 2001
+From: Brian Matherly <brian.matherly@yahoo.com>
+Date: Mon, 11 Sep 2023 20:41:59 -0500
+Subject: [PATCH] Fix crash dereferencing freed pointer
+
+If the producer is deleted by the application before the avformat_producer
+is freed from the cache, then the avformat_producer destructor might
+try to access the freed producer.
+
+Hold a reference to the producer until the avformat_producer is also
+closed.
+
+--
+
+See also the seemingly FreeBSD-specific issue filed by jhale@:
+https://github.com/mltframework/mlt/issues/959
+multimedia/shotcut (even more recent Qt6-based versions) reproducibly crashes
+when using the undo operation without this patch. multimedia/kdenlive does not
+seem to be affected. This port builds with and without this patch, so please
+check multimedia/shotcut runtime before removing.
+
+--- src/modules/avformat/producer_avformat.c.orig	2023-11-29 04:03:52 UTC
++++ src/modules/avformat/producer_avformat.c
+@@ -220,11 +220,12 @@ mlt_producer producer_avformat_init(mlt_profile profil
+ 
+         // Initialise it
+         if (mlt_producer_init(producer, self) == 0) {
+-            self->parent = producer;
+-
+             // Get the properties
+             mlt_properties properties = MLT_PRODUCER_PROPERTIES(producer);
+ 
++            self->parent = producer;
++            mlt_properties_inc_ref(properties);
++
+             // Set the resource property (required for all producers)
+             mlt_properties_set(properties, "resource", file);
+ 
+@@ -3739,6 +3740,7 @@ static int producer_get_frame(mlt_producer producer, m
+     if (!self) {
+         self = calloc(1, sizeof(struct producer_avformat_s));
+         self->parent = producer;
++        mlt_properties_inc_ref(MLT_PRODUCER_PROPERTIES(producer));
+         mlt_service_cache_put(service,
+                               "producer_avformat",
+                               self,
+@@ -3928,6 +3930,7 @@ static void producer_avformat_close(producer_avformat 
+         self->vpackets = NULL;
+     }
+ 
++    mlt_properties_dec_ref(MLT_PRODUCER_PROPERTIES(self->parent));
+     free(self);
+ }
+ 
diff --git a/multimedia/mlt7/files/patch-src_modules_rtaudio_CMakeLists.txt b/multimedia/mlt7/files/patch-src_modules_rtaudio_CMakeLists.txt
index 04f702b7560d..af5498ce5056 100644
--- a/multimedia/mlt7/files/patch-src_modules_rtaudio_CMakeLists.txt
+++ b/multimedia/mlt7/files/patch-src_modules_rtaudio_CMakeLists.txt
@@ -1,6 +1,6 @@
---- src/modules/rtaudio/CMakeLists.txt.orig	2021-05-06 21:36:06 UTC
+--- src/modules/rtaudio/CMakeLists.txt.orig	2023-12-06 23:26:22 UTC
 +++ src/modules/rtaudio/CMakeLists.txt
-@@ -25,7 +25,11 @@ else()
+@@ -32,7 +32,11 @@ else()
        target_compile_definitions(mltrtaudio PRIVATE __LINUX_PULSE__)
      endif()
      if(NOT (TARGET PkgConfig::alsa OR TARGET PkgConfig::libpulse-simple))
diff --git a/multimedia/mlt7/files/patch-src_modules_rtaudio_RtAudio.cpp b/multimedia/mlt7/files/patch-src_modules_rtaudio_RtAudio.cpp
deleted file mode 100644
index e5c1e60d8495..000000000000
--- a/multimedia/mlt7/files/patch-src_modules_rtaudio_RtAudio.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
---- src/modules/rtaudio/RtAudio.cpp.orig	2021-05-06 21:27:47 UTC
-+++ src/modules/rtaudio/RtAudio.cpp
-@@ -8696,8 +8696,10 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigne
-     info.nativeFormats |= RTAUDIO_SINT8;
-   if ( mask & AFMT_S32_LE || mask & AFMT_S32_BE )
-     info.nativeFormats |= RTAUDIO_SINT32;
-+#ifdef AFMT_FLOAT
-   if ( mask & AFMT_FLOAT )
-     info.nativeFormats |= RTAUDIO_FLOAT32;
-+#endif
-   if ( mask & AFMT_S24_LE || mask & AFMT_S24_BE )
-     info.nativeFormats |= RTAUDIO_SINT24;
- 
-@@ -9024,7 +9026,7 @@ bool RtApiOss :: probeDeviceOpen( unsigned int device,
-   }
- 
-   // Verify the sample rate setup worked.
--  if ( abs( srate - sampleRate ) > 100 ) {
-+  if ( abs( long( srate - sampleRate ) ) > 100 ) {
-     close( fd );
-     errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support sample rate (" << sampleRate << ").";
-     errorText_ = errorStream_.str();
diff --git a/multimedia/mlt7/pkg-plist b/multimedia/mlt7/pkg-plist
index f69d45c911d5..8c56d66642fb 100644
--- a/multimedia/mlt7/pkg-plist
+++ b/multimedia/mlt7/pkg-plist
@@ -156,6 +156,7 @@ share/man/man1/melt-7.1.gz
 %%DATADIR%%/core/transition_mix.yml
 %%DECKLINK%%%%DATADIR%%/decklink/consumer_decklink.yml
 %%DECKLINK%%%%DATADIR%%/decklink/producer_decklink.yml
+%%FREI0R%%%%DATADIR%%/frei0r/aliases.yaml
 %%FREI0R%%%%DATADIR%%/frei0r/blacklist.txt
 %%FREI0R%%%%DATADIR%%/frei0r/filter_cairoblend_mode.yml
 %%FREI0R%%%%DATADIR%%/frei0r/not_thread_safe.txt