From 858c1207b9f208778b903dee4f430f2242a9cba5 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:45 -0400 Subject: [PATCH 01/25] avidemux: update to 2.8.1 --- srcpkgs/avidemux/files/negative-shift.patch | 73 +++++++++++++++++++++ srcpkgs/avidemux/patches/musl-nullptr.patch | 26 ++++++++ srcpkgs/avidemux/template | 25 +++++-- 3 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/avidemux/files/negative-shift.patch create mode 100644 srcpkgs/avidemux/patches/musl-nullptr.patch diff --git a/srcpkgs/avidemux/files/negative-shift.patch b/srcpkgs/avidemux/files/negative-shift.patch new file mode 100644 index 00000000000000..ddd3fa2a8e29aa --- /dev/null +++ b/srcpkgs/avidemux/files/negative-shift.patch @@ -0,0 +1,73 @@ + +From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= +Date: Sun, 16 Jul 2023 18:18:02 +0300 +Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift + instructions within inline assembly + +Fixes assembling with binutil as >= 2.41 + +Signed-off-by: James Almer +--- + libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h +index 6298f5ed1983b..ca7e2dffc1076 100644 +--- libavcodec/x86/mathops.h ++++ libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } diff --git a/srcpkgs/avidemux/patches/musl-nullptr.patch b/srcpkgs/avidemux/patches/musl-nullptr.patch new file mode 100644 index 00000000000000..1568173cb0a8c0 --- /dev/null +++ b/srcpkgs/avidemux/patches/musl-nullptr.patch @@ -0,0 +1,26 @@ +--- a/avidemux_plugins/ADM_muxers/muxerMp4/muxerMP4Config.cpp ++++ b/avidemux_plugins/ADM_muxers/muxerMp4/muxerMP4Config.cpp +@@ -34,17 +34,17 @@ + bool force = muxerConfig.forceAspectRatio; + + #ifndef MUXER_IS_MOV +- diaMenuEntry format[]={{MP4_MUXER_MP4,"MP4"},{MP4_MUXER_PSP,"PSP"},NULL}; ++ diaMenuEntry format[]={{MP4_MUXER_MP4,"MP4"},{MP4_MUXER_PSP,"PSP"},0}; + diaElemMenu menuFormat(&fmt,QT_TRANSLATE_NOOP("mp4muxer","Muxing Format"),2,format,""); + diaMenuEntry streamOpt[]={ +- {MP4_MUXER_OPT_NONE,QT_TRANSLATE_NOOP("mp4muxer","No optimization"),NULL}, +- {MP4_MUXER_OPT_FASTSTART,QT_TRANSLATE_NOOP("mp4muxer","Move index to the beginning of the file"),NULL}, +- {MP4_MUXER_OPT_FRAGMENT,QT_TRANSLATE_NOOP("mp4muxer","Use fragmentation"),NULL} ++ {MP4_MUXER_OPT_NONE,QT_TRANSLATE_NOOP("mp4muxer","No optimization"),0}, ++ {MP4_MUXER_OPT_FASTSTART,QT_TRANSLATE_NOOP("mp4muxer","Move index to the beginning of the file"),0}, ++ {MP4_MUXER_OPT_FRAGMENT,QT_TRANSLATE_NOOP("mp4muxer","Use fragmentation"),0} + }; + #else + diaMenuEntry streamOpt[]={ +- {MP4_MUXER_OPT_NONE,QT_TRANSLATE_NOOP("mp4muxer","No optimization"),NULL}, +- {MP4_MUXER_OPT_FASTSTART,QT_TRANSLATE_NOOP("mp4muxer","Move index to the beginning of the file"),NULL} ++ {MP4_MUXER_OPT_NONE,QT_TRANSLATE_NOOP("mp4muxer","No optimization"),0}, ++ {MP4_MUXER_OPT_FASTSTART,QT_TRANSLATE_NOOP("mp4muxer","Move index to the beginning of the file"),0} + }; + + #endif diff --git a/srcpkgs/avidemux/template b/srcpkgs/avidemux/template index 253a0243e22599..53519e72bd9822 100644 --- a/srcpkgs/avidemux/template +++ b/srcpkgs/avidemux/template @@ -1,14 +1,14 @@ # Template file for 'avidemux' pkgname=avidemux -version=2.8.0 -revision=2 +version=2.8.1 +revision=1 # Can't be compiled for aarch64, arm* or mips* archs="x86_64* i686*" hostmakedepends="cmake pkg-config qt5-host-tools qt5-devel tar yasm" makedepends="alsa-lib-devel faac-devel faad2-devel gettext-devel jack-devel glu-devel lame-devel libass-devel libdca-devel libvorbis-devel libXv-devel vapoursynth-devel libmp4v2-devel sqlite-devel libva-devel libvdpau-devel - qt5-multimedia-devel qt5-script-devel qt5-tools-devel ffmpeg-devel + qt5-multimedia-devel qt5-script-devel qt5-tools-devel ffmpeg6-devel liba52-devel libmad-devel x264-devel x265-devel xvidcore-devel" short_desc="Video editing and processing application" maintainer="Orphaned " @@ -16,23 +16,34 @@ license="GPL-2.0-or-later" homepage="http://avidemux.sourceforge.net/" changelog="http://avidemux.sourceforge.net/news.html" distfiles="${SOURCEFORGE_SITE}/avidemux/avidemux/${version}/${pkgname}_${version}.tar.gz" -checksum=d1ec6f5277e51228ecf0ee1ca89fae24c591f520f87ce96fabec8818d04de33b +checksum=77d9bdca8683ce57c192b69d207cfab7cf92a7759ce0f63fa37b5c8e42ad3da2 # On i686 the build fails with "error: 'asm' operand has impossible constraints" # due to not enough available CPU registers. Using the -fno-PIC flag frees up # one additional register for the compiler/assembler to use. case "${XBPS_TARGET_MACHINE}" in - i686*) CFLAGS="-fno-PIC";; + i686*) CFLAGS="-fno-PIC" ;; esac +# uses parts of an internal ffmpeg4.4.2 tar +post_extract() { + cp ${FILESDIR}/*patch ${wrksrc}/avidemux_core/ffmpeg_package/patches/ +} + +# soundtouch fails to use 128bit xmm registers on i686 +# deadbeef has a similar problem do_configure() { + case "${XBPS_TARGET_MACHINE}" in + i686*) + vsed '1iADD_DEFINITIONS(-DSOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS=1)' \ + -i avidemux/common/ADM_audioFilter/src/CMakeLists.txt ;; + esac MAKEFLAGS=${makejobs} \ bash bootStrap.bash \ --with-system-libass \ --with-system-liba52 \ --with-system-libmad \ - --with-system-libmp4v2 \ - ${cross_compile} + --with-system-libmp4v2 } do_install() { From a56c80253c173d355671f5d6f898168e6f42a8dc Mon Sep 17 00:00:00 2001 From: zlice Date: Sun, 21 Jul 2024 22:44:56 -0400 Subject: [PATCH 02/25] idjc: revbump for ffmpeg6 --- srcpkgs/idjc/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/idjc/template b/srcpkgs/idjc/template index f6b2918eebeb82..54423bd7cb6243 100644 --- a/srcpkgs/idjc/template +++ b/srcpkgs/idjc/template @@ -1,11 +1,11 @@ # Template file for 'idjc' pkgname=idjc version=0.9.8 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="pkg-config git python3 automake gettext-devel libtool" makedepends="libvorbis-devel libogg-devel jack-devel libsamplerate-devel - libflac-devel libsndfile-devel mpg123-devel ffmpeg-devel speex-devel + libflac-devel libsndfile-devel mpg123-devel ffmpeg6-devel speex-devel glib-devel pixman-devel lame-devel python3-gobject-devel libshout-idjc-devel opus-devel twolame-devel python3-mutagen python3-devel libebur128-devel" depends="python3-gobject python3-mutagen desktop-file-utils shared-mime-info python3-dbus jack" From 07e40fb2248440d5203f4ef32b0eb2e65759ec77 Mon Sep 17 00:00:00 2001 From: zlice Date: Sun, 15 Oct 2023 21:47:18 -0400 Subject: [PATCH 03/25] libopenshot: revbump for ffmpeg6 --- srcpkgs/libopenshot/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/libopenshot/template b/srcpkgs/libopenshot/template index fc45a258057079..2da22764f66e9b 100644 --- a/srcpkgs/libopenshot/template +++ b/srcpkgs/libopenshot/template @@ -1,13 +1,13 @@ # Template file for 'libopenshot' pkgname=libopenshot version=0.3.2 -revision=1 +revision=2 build_style=cmake # Builds fail with Ruby-2.4.1 configure_args="-DENABLE_RUBY=OFF -DUSE_SYSTEM_JSONCPP=ON" hostmakedepends="swig doxygen ruby python3 python3-setuptools pkg-config qt5-qmake qt5-host-tools" -makedepends="python3-devel ffmpeg-devel libmagick-devel qt5-devel libgomp-devel +makedepends="python3-devel ffmpeg6-devel libmagick-devel qt5-devel libgomp-devel libopenshot-audio-devel qt5-multimedia-devel unittest-cpp zeromq-devel cppzmq jsoncpp-devel qt5-svg-devel" depends="python3" From 208a6245d8d8b5756ae1000fe4d40eeb26ec878f Mon Sep 17 00:00:00 2001 From: zlice Date: Sun, 15 Oct 2023 21:18:14 -0400 Subject: [PATCH 04/25] openshot: revbump for ffmpeg6 --- srcpkgs/openshot/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/openshot/template b/srcpkgs/openshot/template index 3849858fe963b5..13d949bae91048 100644 --- a/srcpkgs/openshot/template +++ b/srcpkgs/openshot/template @@ -1,10 +1,10 @@ # Template file for 'openshot' pkgname=openshot version=3.1.1 -revision=1 +revision=2 build_style=python3-module hostmakedepends="python3 python3-setuptools" -makedepends="ffmpeg-devel python3-PyQt5" +makedepends="ffmpeg6-devel python3-PyQt5" depends="ImageMagick libopenshot python3-PyQt5-svg python3-PyQt5-webkit python3-httplib2 python3-pyzmq python3-requests" short_desc="Open-source, non-linear video editor for Linux" From 2f6d7ebeae5150bab1111c7436c8d65aabfb3ad5 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:52 -0400 Subject: [PATCH 05/25] synfig: revbump for ffmpeg6 and mlt7 --- srcpkgs/synfig/patches/ffmpeg6.patch | 71 ++++++++++++++++++++++++++++ srcpkgs/synfig/template | 8 ++-- 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/synfig/patches/ffmpeg6.patch diff --git a/srcpkgs/synfig/patches/ffmpeg6.patch b/srcpkgs/synfig/patches/ffmpeg6.patch new file mode 100644 index 00000000000000..10780b42782f4b --- /dev/null +++ b/srcpkgs/synfig/patches/ffmpeg6.patch @@ -0,0 +1,71 @@ +--- a/src/modules/mod_libavcodec/trgt_av.cpp 2022-10-25 09:14:12.000000000 -0400 ++++ b/src/modules/mod_libavcodec/trgt_av.cpp 2023-05-05 21:34:17.899194559 -0400 +@@ -38,6 +41,7 @@ + extern "C" + { + #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H ++# include + # include + #elif defined(HAVE_AVFORMAT_H) + # include +@@ -155,11 +156,11 @@ + } + + bool open_video_stream() { +- if (avcodec_open2(video_context, NULL, NULL) < 0) { ++ if (avcodec_open2(video_context, nullptr, nullptr) < 0) { + synfig::error("Target_LibAVCodec: could not open video codec"); + // seems the calling of avcodec_free_context after error will cause crash + // so just forget about this context +- video_context = NULL; ++ video_context = nullptr; + close(); + return false; + } +@@ -234,15 +235,21 @@ + close(); + + if (!av_registered) { ++#if LIBAVCODEC_VERSION_MAJOR < 58 // FFMPEG < 4.0 + av_register_all(); ++#endif + av_registered = true; + } + + // guess format +- AVOutputFormat *format = av_guess_format(NULL, filename.c_str(), NULL); ++#if LIBAVCODEC_VERSION_MAJOR < 59 // FFMPEG < 5.0 ++ AVOutputFormat* format = av_guess_format(nullptr, filename.c_str(), nullptr); ++#else ++ const AVOutputFormat* format = av_guess_format(nullptr, filename.c_str(), nullptr); ++#endif + if (!format) { + synfig::warning("Target_LibAVCodec: unable to guess the output format, defaulting to MPEG"); +- format = av_guess_format("mpeg", NULL, NULL); ++ format = av_guess_format("mpeg", nullptr, nullptr); + } + if (!format) { + synfig::error("Target_LibAVCodec: unable to find 'mpeg' output format"); +@@ -254,6 +261,7 @@ + context = avformat_alloc_context(); + assert(context); + context->oformat = format; ++#if LIBAVCODEC_VERSION_MAJOR < 58 // FFMPEG < 4.0 + if (filename.size() + 1 > sizeof(context->filename)) { + synfig::error( + "Target_LibAVCodec: filename too long, max length is %d, filename is '%s'", +@@ -263,6 +271,14 @@ + return false; + } + memcpy(context->filename, filename.c_str(), filename.size() + 1); ++#else ++ context->url = av_strndup(filename.c_str(), filename.size()); ++ if (!context->url) { ++ synfig::error("Target_LibAVCodec: cannot allocate space for filename"); ++ close(); ++ return false; ++ } ++#endif + + packet = av_packet_alloc(); + assert(packet); diff --git a/srcpkgs/synfig/template b/srcpkgs/synfig/template index 510eb2b4dbf05d..6308bdf1758124 100644 --- a/srcpkgs/synfig/template +++ b/srcpkgs/synfig/template @@ -2,12 +2,12 @@ # Should be kept in sync with 'synfigstudio' and 'ETL' pkgname=synfig version=1.4.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib" hostmakedepends="boost-build ImageMagick pkg-config intltool" -makedepends="ETL gettext-devel libxml++-devel mlt-devel libmagick-devel - libmng-devel boost-build boost-devel libopenexr-devel ffmpeg-devel" +makedepends="ETL gettext-devel libxml++-devel mlt7-devel libmagick-devel + libmng-devel boost-build boost-devel libopenexr-devel ffmpeg6-devel" depends="ImageMagick" short_desc="CLI 2D vector and timeline-based animation software" maintainer="Orphaned " @@ -20,7 +20,7 @@ CXXFLAGS="-std=c++11 -DHAVE_LOCALE_H=1" synfig-devel_package() { depends="${sourcepkg}>=${version}_${revision} - libopenexr-devel libxml++-devel mlt-devel" + libopenexr-devel libxml++-devel mlt7-devel" short_desc+=" - development files" pkg_install() { vmove usr/bin/synfig-config From fd44589f2706c1a143d72d6625c601b8c9fbc5dd Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 8 Nov 2023 10:11:57 -0500 Subject: [PATCH 06/25] synfigstudio: revbump for ffmpeg6 --- srcpkgs/synfigstudio/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/synfigstudio/template b/srcpkgs/synfigstudio/template index 5cde919b703343..db86252c95d6fe 100644 --- a/srcpkgs/synfigstudio/template +++ b/srcpkgs/synfigstudio/template @@ -2,7 +2,7 @@ # Should be kept in sync with 'synfig' and 'ETL' pkgname=synfigstudio version=1.4.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--disable-update-mimedb" hostmakedepends="pkg-config intltool gettext synfig" From 916e026e6918baadea0525ecb0f7004026ebdb62 Mon Sep 17 00:00:00 2001 From: zlice Date: Sun, 21 Jul 2024 22:50:26 -0400 Subject: [PATCH 07/25] mlt: remove package --- common/shlibs | 2 - srcpkgs/mlt-data | 1 - srcpkgs/mlt-devel | 1 - srcpkgs/mlt-doc | 1 - srcpkgs/mlt-python | 1 - srcpkgs/mlt-python3 | 1 - srcpkgs/mlt/template | 98 ------------------------------- srcpkgs/mlt/update | 1 - srcpkgs/removed-packages/template | 6 ++ 9 files changed, 6 insertions(+), 106 deletions(-) delete mode 120000 srcpkgs/mlt-data delete mode 120000 srcpkgs/mlt-devel delete mode 120000 srcpkgs/mlt-doc delete mode 120000 srcpkgs/mlt-python delete mode 120000 srcpkgs/mlt-python3 delete mode 100644 srcpkgs/mlt/template delete mode 100644 srcpkgs/mlt/update diff --git a/common/shlibs b/common/shlibs index 045ddaf9a0e818..7bc84e629277b2 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2505,8 +2505,6 @@ libsybdb.so.5 freetds-0.95.19_1 libqqwing.so.2 qqwing-1.3.4_1 libiniparser.so.4 iniparser-4.2.4_1 libzita-resampler.so.1 zita-resampler-1.3.0_1 -libmlt.so.6 mlt-6.4.1_1 -libmlt++.so.3 mlt-6.4.1_1 libmlt++-7.so.7 mlt7-7.0.1_1 libmlt-7.so.7 mlt7-7.0.1_1 libunibilium.so.4 unibilium-2.0.0_1 diff --git a/srcpkgs/mlt-data b/srcpkgs/mlt-data deleted file mode 120000 index 9487c215e3fc5c..00000000000000 --- a/srcpkgs/mlt-data +++ /dev/null @@ -1 +0,0 @@ -mlt \ No newline at end of file diff --git a/srcpkgs/mlt-devel b/srcpkgs/mlt-devel deleted file mode 120000 index 9487c215e3fc5c..00000000000000 --- a/srcpkgs/mlt-devel +++ /dev/null @@ -1 +0,0 @@ -mlt \ No newline at end of file diff --git a/srcpkgs/mlt-doc b/srcpkgs/mlt-doc deleted file mode 120000 index 9487c215e3fc5c..00000000000000 --- a/srcpkgs/mlt-doc +++ /dev/null @@ -1 +0,0 @@ -mlt \ No newline at end of file diff --git a/srcpkgs/mlt-python b/srcpkgs/mlt-python deleted file mode 120000 index 9487c215e3fc5c..00000000000000 --- a/srcpkgs/mlt-python +++ /dev/null @@ -1 +0,0 @@ -mlt \ No newline at end of file diff --git a/srcpkgs/mlt-python3 b/srcpkgs/mlt-python3 deleted file mode 120000 index 9487c215e3fc5c..00000000000000 --- a/srcpkgs/mlt-python3 +++ /dev/null @@ -1 +0,0 @@ -mlt \ No newline at end of file diff --git a/srcpkgs/mlt/template b/srcpkgs/mlt/template deleted file mode 100644 index 73e3915aaab9ac..00000000000000 --- a/srcpkgs/mlt/template +++ /dev/null @@ -1,98 +0,0 @@ -# Template file for 'mlt' -pkgname=mlt -version=6.26.1 -revision=3 -build_style=configure -configure_args="--prefix=/usr --libdir=/usr/lib$XBPS_TARGET_WORDSIZE - --enable-gpl --enable-gpl3 --disable-swfdec --without-kde - --swig-languages=python" -hostmakedepends="doxygen pkg-config ladspa-sdk swig python3 which" -# XXX: movit vid.stab -makedepends="alsa-lib-devel ffmpeg-devel gtk+-devel jack-devel ladspa-sdk - libexif-devel libsamplerate-devel libxml2-devel sox-devel SDL_image-devel - fftw-devel frei0r-plugins python3-devel pulseaudio-devel movit-devel - libvidstab-devel" -depends="mlt-data>=${version}_${revision} ladspa-sdk-example-plugins" -short_desc="Multimedia framework, designed for television broadcasting" -maintainer="Orphaned " -license="GPL-3.0-or-later, LGPL-2.1-or-later" -homepage="https://mltframework.org/" -distfiles="https://github.com/mltframework/mlt/archive/v${version}.tar.gz" -checksum=8a484bbbf51f33e25312757531f3ad2ce20607149d20fcfcb40a3c1e60b20b4e - -CFLAGS+=" -DHAVE_STRTOD_L=1 -DHAVE_LOCALE_H=1" -CXXFLAGS+=" -DHAVE_STRTOD_L=1 -DHAVE_LOCALE_H=1" - -if [ "$XBPS_TARGET_LIBC" = "musl" ]; then - makedepends+=" musl-legacy-compat" -fi - -if [ "$CROSS_BUILD" ]; then - make_build_args="CROSS=${XBPS_CROSS_TRIPLET}-" -else - makedepends+=" qt5-svg-devel" -fi - -do_configure() { - vsed -i src/swig/python/build \ - -e "s,PYTHON_INCLUDE=.*,PYTHON_INCLUDE=-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}," - - # Enable or disable mmx, sse, sse2 - case "${XBPS_TARGET_MACHINE}" in - x86_64*|i686*) - configure_args+=" --enable-mmx" - ;; - *) - configure_args+=" --disable-mmx --disable-sse --disable-sse2" - ;; - esac - ./configure ${configure_args} -} -post_install() { - vman docs/melt.1 - doxygen -u && doxygen - vmkdir usr/share/doc/mlt/html - vcopy "docs/*.txt" usr/share/doc/mlt - vcopy "docs/html/*" usr/share/doc/mlt/html -} - -mlt-data_package() { - short_desc+=" - data files" - pkg_install() { - vmove usr/share/mlt - } -} - -mlt-doc_package() { - short_desc+=" - documentation" - pkg_install() { - vmove usr/share/doc - } -} - -mlt-devel_package() { - short_desc+=" - development files" - depends="${makedepends} ${sourcepkg}>=${version}_${revision}" - pkg_install() { - vmove usr/include - vmove usr/lib/pkgconfig - vmove "usr/lib/*.so" - } -} - -mlt-python3_package() { - lib32disabled=yes - short_desc+=" - Python bindings" - depends="${sourcepkg}>=${version}_${revision}" - pkg_install() { - cd src/swig/python - vinstall mlt.py 644 "usr/lib/python${py3_ver}" - vinstall _mlt.so 755 "usr/lib/python${py3_ver}" - } -} - -mlt-python_package() { - build_style=meta - short_desc+=" - transitional dummy pkg" - depends="mlt-python3-${version}_${revision}" -} diff --git a/srcpkgs/mlt/update b/srcpkgs/mlt/update deleted file mode 100644 index 547ae2837eb9ac..00000000000000 --- a/srcpkgs/mlt/update +++ /dev/null @@ -1 +0,0 @@ -ignore="7.*" diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template index bc7edb77a764ed..aa2fd9e48c52c1 100644 --- a/srcpkgs/removed-packages/template +++ b/srcpkgs/removed-packages/template @@ -454,6 +454,12 @@ replaces=" mimms<=3.2.1_4 miro-video-converter<=3.0.2_3 mirrorbits<=0.5.1_1 + mlt<=6.26.1_3 + mlt-data<=6.26.1_3 + mlt-devel<=6.26.1_3 + mlt-doc<=6.26.1_3 + mlt-python<=6.26.1_3 + mlt-python3<=6.26.1_3 modemmanager-qt5<=5.115.0_1 monero-devel<=0.18.1.2_4 monero-gui<=0.18.1.2_4 From 422f710d11460c1978f1d08c4b130ba6fb70cdc7 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:13 -0400 Subject: [PATCH 08/25] xine-lib: revbump for ffmpeg6 --- srcpkgs/xine-lib/template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srcpkgs/xine-lib/template b/srcpkgs/xine-lib/template index 3be4d08eac77a3..f54ad0a91e15c7 100644 --- a/srcpkgs/xine-lib/template +++ b/srcpkgs/xine-lib/template @@ -1,14 +1,14 @@ # Template file for 'xine-lib' pkgname=xine-lib -version=1.2.12 -revision=3 +version=1.2.13 +revision=1 build_style=gnu-configure configure_args="--disable-vcd --disable-gnomevfs --without-esound --disable-dxr3 --disable-oss" hostmakedepends="automake gettext-devel libtool pkg-config perl" makedepends=" zlib-devel alsa-lib-devel libxcb-devel libSM-devel libXext-devel libXv-devel - libXvMC-devel liba52-devel libmad-devel ffmpeg-devel pulseaudio-devel + libXvMC-devel liba52-devel libmad-devel ffmpeg6-devel pulseaudio-devel jack-devel samba-devel libflac-devel libmodplug-devel libmpcdec-devel speex-devel libtheora-devel libvorbis-devel libdca-devel faad2-devel libcdio-devel libbluray-devel aalib-devel libcaca-devel libXinerama-devel @@ -19,7 +19,7 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later" homepage="http://www.xine-project.org" changelog="https://sourceforge.net/projects/xine/files/xine-lib/${version}/README.txt/view" distfiles="${SOURCEFORGE_SITE}/xine/${pkgname}-${version}.tar.xz" -checksum=d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098 +checksum=5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f case "$XBPS_TARGET_MACHINE" in i686-musl) From 6b7a9692ae38449f66ee6bbdf1f4d7eb875e014b Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:00:55 -0400 Subject: [PATCH 09/25] osg: revbump for ffmpeg6 --- srcpkgs/osg/patches/ffmpeg5.patch | 490 ++++++++++++++++++++++++++++++ srcpkgs/osg/template | 4 +- 2 files changed, 492 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/osg/patches/ffmpeg5.patch diff --git a/srcpkgs/osg/patches/ffmpeg5.patch b/srcpkgs/osg/patches/ffmpeg5.patch new file mode 100644 index 00000000000000..ae46dcd4c467e3 --- /dev/null +++ b/srcpkgs/osg/patches/ffmpeg5.patch @@ -0,0 +1,490 @@ +Index: openscenegraph-3.6.5+dfsg1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp +=================================================================== +--- openscenegraph-3.6.5+dfsg1.orig/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp ++++ openscenegraph-3.6.5+dfsg1/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp +@@ -45,12 +45,19 @@ static int decode_audio(AVCodecContext * + if (!frame) + return AVERROR(ENOMEM); + +- ret = avcodec_decode_audio4(avctx, frame, &got_frame, &avpkt); ++ ret = avcodec_send_packet(avctx, &avpkt); ++ if (ret >= 0) { ++ ret = avcodec_receive_frame(avctx, frame); ++ if (ret == 0) { ++ got_frame = 1; ++ } ++ } ++ + + #ifdef USE_AVRESAMPLE // libav's AVFrame structure does not contain a 'channels' field + if (ret >= 0 && got_frame) { + #else +- if (ret >= 0 && got_frame && av_frame_get_channels(frame)>0) { ++ if (ret >= 0 && got_frame && frame->ch_layout.nb_channels>0) { + #endif + int ch, plane_size; + int planar = av_sample_fmt_is_planar(avctx->sample_fmt); +@@ -151,11 +158,13 @@ void FFmpegDecoderAudio::open(AVStream * + return; + + m_stream = stream; +- m_context = stream->codec; +- +- m_in_sample_rate = m_context->sample_rate; +- m_in_nb_channels = m_context->channels; +- m_in_sample_format = m_context->sample_fmt; ++ AVCodecParameters* avp = stream->codecpar; ++ const AVCodec * p_codec = avcodec_find_decoder(avp->codec_id); ++ m_context = avcodec_alloc_context3(p_codec); ++ ++ m_in_sample_rate = avp->sample_rate; ++ m_in_nb_channels = avp->channels; ++ m_in_sample_format = ((AVSampleFormat)(avp->format)); + + AVDictionaryEntry *opt_out_sample_rate = av_dict_get( *parameters->getOptions(), "out_sample_rate", NULL, 0 ); + if ( opt_out_sample_rate ) +@@ -210,11 +219,10 @@ printf("### CONVERTING from sample forma + } + + // Check stream sanity +- if (m_context->codec_id == AV_CODEC_ID_NONE) ++ if (avp->codec_id == AV_CODEC_ID_NONE) + throw std::runtime_error("invalid audio codec");; + + // Find the decoder for the audio stream +- AVCodec * const p_codec = avcodec_find_decoder(m_context->codec_id); + + if (p_codec == 0) + throw std::runtime_error("avcodec_find_decoder() failed"); +diff -Naur old/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp new/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp +--- old/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp 2023-11-26 08:09:37.280442193 +1000 +@@ -62,7 +62,7 @@ + { + // Open video file + AVFormatContext * p_format_context = 0; +- AVInputFormat *iformat = 0; ++ const AVInputFormat *iformat = 0; + + if (filename.compare(0, 5, "/dev/")==0) + { +@@ -304,12 +304,11 @@ + else + { + // Make the packet data available beyond av_read_frame() logical scope. +- if ((error = av_dup_packet(&packet)) < 0) { +- OSG_FATAL << "av_dup_packet() returned " << AvStrError(error) << std::endl; +- throw std::runtime_error("av_dup_packet() failed"); ++ if ((error = av_packet_ref(&(m_pending_packet.packet), &packet)) < 0) { ++ OSG_FATAL << "av_packet_ref() returned " << AvStrError(error) << std::endl; ++ throw std::runtime_error("av_packet_ref() failed"); + } +- +- m_pending_packet = FFmpegPacket(packet); ++ m_pending_packet.type = FFmpegPacket::PACKET_DATA; + } + } + +diff -Naur old/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp new/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp +--- old/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp 2023-11-26 13:07:02.501812075 +1000 +@@ -6,6 +6,9 @@ + #include + #include + ++#include ++ ++ + namespace osgFFmpeg { + + // TODO - add support for using RGB or RGBA pixel format. +@@ -18,8 +21,6 @@ + m_stream(0), + m_context(0), + m_codec(0), +- m_packet_data(0), +- m_bytes_remaining(0), + m_packet_pts(AV_NOPTS_VALUE), + m_writeBuffer(0), + m_user_data(0), +@@ -61,8 +62,12 @@ + + void FFmpegDecoderVideo::open(AVStream * const stream) + { ++ int linesizes[4]; ++ + m_stream = stream; +- m_context = stream->codec; ++ ++ if (avcodec_parameters_to_context(m_context, stream->codecpar) < 0) ++ throw std::runtime_error("avcodec_parameters_to_context() failed inside FFMpegDecoderVideo::open()"); + + // Trust the video size given at this point + // (avcodec_open seems to sometimes return a 0x0 size) +@@ -99,11 +104,15 @@ + + // Allocate converted RGB frame + m_frame_rgba.reset(av_frame_alloc()); +- m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height())); ++ m_buffer_rgba[0].resize(av_image_get_buffer_size(AV_PIX_FMT_RGB24, width(), height(), 1)); + m_buffer_rgba[1].resize(m_buffer_rgba[0].size()); + + // Assign appropriate parts of the buffer to image planes in m_frame_rgba ++#if BCS + avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height()); ++#else ++ av_image_fill_arrays(m_frame_rgba.get()->data, linesizes, &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height(), 1); ++#endif + + // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame. + m_context->opaque = this; +@@ -148,128 +157,123 @@ + } + + +- +-void FFmpegDecoderVideo::decodeLoop() ++double FFmpegDecoderVideo::calculateFramePTS(int64_t packet_dts) + { +- FFmpegPacket packet; +- double pts; ++ double pts = 0; + +- while (! m_exit) ++#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(57,24,102) ++ //ffmpeg-3.0 and below ++ AVRational timebase; ++ // Find out the frame pts ++ if (m_frame->pts != int64_t(AV_NOPTS_VALUE)) + { +- // Work on the current packet until we have decoded all of it +- +- while (m_bytes_remaining > 0) +- { +- // Save global PTS to be stored in m_frame via getBuffer() ++ pts = m_frame->pts; ++ timebase = m_context->time_base; ++ } ++ else if (packet_dts == int64_t(AV_NOPTS_VALUE) && ++ m_frame->opaque != 0 && ++ *reinterpret_cast(m_frame->opaque) != int64_t(AV_NOPTS_VALUE)) ++ { ++ pts = *reinterpret_cast(m_frame->opaque); ++ timebase = m_stream->time_base; ++ } ++ else if (packet_dts != int64_t(AV_NOPTS_VALUE)) ++ { ++ pts = packet_dts; ++ timebase = m_stream->time_base; ++ } ++ else ++ { ++ timebase = m_context->time_base; ++ } + +- m_packet_pts = packet.packet.pts; ++ pts *= av_q2d(timebase); + +- // Decode video frame ++#else ++ //above ffmpeg-3.0 ++ // Find out the frame pts ++ if (m_frame->pts != int64_t(AV_NOPTS_VALUE)) ++ { ++ pts = av_q2d(m_stream->time_base) * m_frame->pts; ++ } ++ else if (packet_dts == int64_t(AV_NOPTS_VALUE) && ++ m_frame->opaque != 0 && ++ *reinterpret_cast(m_frame->opaque) != int64_t(AV_NOPTS_VALUE)) ++ { ++ pts = av_q2d(m_stream->time_base) * *reinterpret_cast(m_frame->opaque); ++ } ++ else if (packet_dts != int64_t(AV_NOPTS_VALUE)) ++ { ++ pts = av_q2d(m_stream->time_base) * packet_dts; ++ } ++#endif + +- int frame_finished = 0; ++ return pts; ++} + +- // We want to use the entire packet since some codecs will require extra information for decoding +- const int bytes_decoded = avcodec_decode_video2(m_context, m_frame.get(), &frame_finished, &(packet.packet)); + +- if (bytes_decoded < 0) +- throw std::runtime_error("avcodec_decode_video failed()"); ++void FFmpegDecoderVideo::decodeLoop() ++{ ++ bool need_more_data = true; ++ FFmpegPacket packet; + +- m_bytes_remaining -= bytes_decoded; +- m_packet_data += bytes_decoded; ++ while (! m_exit) ++ { ++ if (need_more_data) ++ { ++ bool is_empty = true; ++ packet = m_packets.timedPop(is_empty, 10); + +- // Publish the frame if we have decoded a complete frame +- if (frame_finished) ++ if (! is_empty) + { +-#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(57,24,102) +- //ffmpeg-3.0 and below +- AVRational timebase; +- // Find out the frame pts +- if (m_frame->pts != int64_t(AV_NOPTS_VALUE)) +- { +- pts = m_frame->pts; +- timebase = m_context->time_base; +- } +- else if (packet.packet.dts == int64_t(AV_NOPTS_VALUE) && +- m_frame->opaque != 0 && +- *reinterpret_cast(m_frame->opaque) != int64_t(AV_NOPTS_VALUE)) +- { +- pts = *reinterpret_cast(m_frame->opaque); +- timebase = m_stream->time_base; +- } +- else if (packet.packet.dts != int64_t(AV_NOPTS_VALUE)) +- { +- pts = packet.packet.dts; +- timebase = m_stream->time_base; +- } +- else +- { +- pts = 0; +- timebase = m_context->time_base; +- } +- +- pts *= av_q2d(timebase); ++ if (packet.type == FFmpegPacket::PACKET_FLUSH) ++ avcodec_flush_buffers(m_context); + +-#else +- //above ffmpeg-3.0 +- // Find out the frame pts +- if (m_frame->pts != int64_t(AV_NOPTS_VALUE)) +- { +- pts = av_q2d(m_stream->time_base) * m_frame->pts; +- } +- else if (packet.packet.dts == int64_t(AV_NOPTS_VALUE) && +- m_frame->opaque != 0 && +- *reinterpret_cast(m_frame->opaque) != int64_t(AV_NOPTS_VALUE)) +- { +- pts = av_q2d(m_stream->time_base) * *reinterpret_cast(m_frame->opaque); +- } +- else if (packet.packet.dts != int64_t(AV_NOPTS_VALUE)) +- { +- pts = av_q2d(m_stream->time_base) * packet.packet.dts; +- } +- else +- { +- pts = 0; +- } +-#endif +- const double synched_pts = m_clocks.videoSynchClock(m_frame.get(), av_q2d(av_inv_q(m_context->framerate)), pts); +- const double frame_delay = m_clocks.videoRefreshSchedule(synched_pts); ++ // Save global PTS to be stored in m_frame via getBuffer() ++ m_packet_pts = packet.packet.pts; + +- publishFrame(frame_delay, m_clocks.audioDisabled()); ++ if (avcodec_send_packet(m_context, &packet.packet) < 0) ++ throw std::runtime_error("avcodec_send_packet() failed inside FFmpegDecoderVideo::decodeLoop()"); + } +- } +- +- while(m_paused && !m_exit) +- { +- microSleep(10000); +- } ++ } + +- // Get the next packet ++ const int decode_status = avcodec_receive_frame(m_context, m_frame.get()); + +- pts = 0; ++ if (decode_status == 0) ++ { ++ // Completed at least one full frame ++ need_more_data = false; + +- if (packet.valid()) +- packet.clear(); ++ const double pts = calculateFramePTS(m_frame.get()->pkt_dts); ++ const double synched_pts = m_clocks.videoSynchClock(m_frame.get(), av_q2d(av_inv_q(m_context->framerate)), pts); ++ const double frame_delay = m_clocks.videoRefreshSchedule(synched_pts); + +- bool is_empty = true; +- packet = m_packets.timedPop(is_empty, 10); ++ publishFrame(frame_delay, m_clocks.audioDisabled()); ++ } ++ else if (decode_status == AVERROR(EOF)) ++ { ++ // Decoder has reached end of the stream ++ return; ++ } ++ else if (decode_status == AVERROR(EAGAIN)) ++ { ++ // Frame not yet complete ++ need_more_data = true; ++ ++ if (packet.valid()) ++ packet.clear(); ++ } ++ else ++ throw std::runtime_error("avcodec_receive_frame() failed inside FFmpegDecoderVideo::decodeLoop()"); + +- if (! is_empty) ++ while(m_paused && !m_exit) + { +- if (packet.type == FFmpegPacket::PACKET_DATA) +- { +- m_bytes_remaining = packet.packet.size; +- m_packet_data = packet.packet.data; +- } +- else if (packet.type == FFmpegPacket::PACKET_FLUSH) +- { +- avcodec_flush_buffers(m_context); +- } ++ microSleep(10000); + } + } + } + + +- + void FFmpegDecoderVideo::findAspectRatio() + { + float ratio = 0.0f; +@@ -283,7 +287,8 @@ + m_pixel_aspect_ratio = ratio; + } + +-int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, AVPicture *src, ++ ++int FFmpegDecoderVideo::convert(AVFrame *dst, int dst_pix_fmt, AVFrame *src, + int src_pix_fmt, int src_width, int src_height) + { + osg::Timer_t startTick = osg::Timer::instance()->tick(); +@@ -318,6 +323,8 @@ + + void FFmpegDecoderVideo::publishFrame(const double delay, bool audio_disabled) + { ++ int linesizes[4]; ++ + // If no publishing function, just ignore the frame + if (m_publish_func == 0) + return; +@@ -334,11 +341,11 @@ + return; + #endif + +- AVPicture * const src = (AVPicture *) m_frame.get(); +- AVPicture * const dst = (AVPicture *) m_frame_rgba.get(); ++ AVFrame * const src = (AVFrame *) m_frame.get(); ++ AVFrame * const dst = (AVFrame *) m_frame_rgba.get(); + + // Assign appropriate parts of the buffer to image planes in m_frame_rgba +- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height()); ++ av_image_fill_arrays(m_frame_rgba.get()->data, linesizes, &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height(), 1); + + // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine + +@@ -370,7 +377,7 @@ + + + +-void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height) ++void FFmpegDecoderVideo::yuva420pToRgba(AVFrame * const dst, AVFrame * const src, int width, int height) + { + convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width, height); + +diff -Naur old/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp new/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp +--- old/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp 2023-11-26 09:34:00.040263426 +1000 +@@ -87,10 +87,11 @@ + void decodeLoop(); + void findAspectRatio(); + void publishFrame(double delay, bool audio_disabled); ++ double calculateFramePTS(int64_t packet_dts); + double synchronizeVideo(double pts); +- void yuva420pToRgba(AVPicture *dst, AVPicture *src, int width, int height); ++ void yuva420pToRgba(AVFrame *dst, AVFrame *src, int width, int height); + +- int convert(AVPicture *dst, int dst_pix_fmt, AVPicture *src, ++ int convert(AVFrame *dst, int dst_pix_fmt, AVFrame *src, + int src_pix_fmt, int src_width, int src_height); + + +@@ -101,9 +102,7 @@ + FFmpegClocks & m_clocks; + AVStream * m_stream; + AVCodecContext * m_context; +- AVCodec * m_codec; +- const uint8_t * m_packet_data; +- int m_bytes_remaining; ++ const AVCodec * m_codec; + int64_t m_packet_pts; + + FramePtr m_frame; +diff -Naur old/src/osgPlugins/ffmpeg/FFmpegPacket.hpp new/src/osgPlugins/ffmpeg/FFmpegPacket.hpp +--- old/src/osgPlugins/ffmpeg/FFmpegPacket.hpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/FFmpegPacket.hpp 2023-11-26 07:20:03.739547190 +1000 +@@ -42,7 +42,7 @@ + void clear() + { + if (packet.data != 0) +- av_free_packet(&packet); ++ av_packet_unref(&packet); + + release(); + } +diff -Naur old/src/osgPlugins/ffmpeg/FFmpegParameters.hpp new/src/osgPlugins/ffmpeg/FFmpegParameters.hpp +--- old/src/osgPlugins/ffmpeg/FFmpegParameters.hpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/FFmpegParameters.hpp 2023-11-26 13:09:25.198807036 +1000 +@@ -20,7 +20,7 @@ + + bool isFormatAvailable() const { return m_format!=NULL; } + +- AVInputFormat* getFormat() { return m_format; } ++ const AVInputFormat* getFormat() { return m_format; } + AVDictionary** getOptions() { return &m_options; } + void setContext(AVIOContext* context) { m_context = context; } + AVIOContext* getContext() { return m_context; } +@@ -29,7 +29,7 @@ + + protected: + +- AVInputFormat* m_format; ++ const AVInputFormat* m_format; + AVIOContext* m_context; + AVDictionary* m_options; + }; +diff -Naur old/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp new/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp +--- old/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp 2020-01-31 21:03:07.000000000 +1000 ++++ new/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp 2023-11-26 13:25:22.060773249 +1000 +@@ -20,7 +20,7 @@ + #include + + +-#if LIBAVCODEC_VERSION_MAJOR >= 53 || \ ++#if (LIBAVCODEC_VERSION_MAJOR>=53 && LIBAVCODEC_VERSION_MAJOR<=58) || \ + (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=30) || \ + (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR==20 && LIBAVCODEC_VERSION_MICRO >= 1) + #define USE_AV_LOCK_MANAGER +@@ -117,8 +117,11 @@ + // enable thread locking + av_lockmgr_register(&lockMgr); + #endif +- // Register all FFmpeg formats/codecs ++ ++#if LIBAVCODEC_VERSION_MAJOR<=57 ++ // Register all FFmpeg formats/codecs--- not required in FFmpeg 4.0 and later + av_register_all(); ++#endif + + avformat_network_init(); + } diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template index 8ef0efc599a1b1..2a89cf2164e133 100644 --- a/srcpkgs/osg/template +++ b/srcpkgs/osg/template @@ -1,14 +1,14 @@ # Template file for 'osg' pkgname=osg version=3.6.5 -revision=3 +revision=4 build_style=cmake build_helper="qemu" # don't use /usr/lib64 on 64bit platforms configure_args="-DLIB_POSTFIX=" hostmakedepends="pkg-config xrandr" makedepends="MesaLib-devel gtkglext-devel libcurl-devel giflib-devel librsvg-devel - jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg-devel xine-lib-devel + jasper-devel tiff-devel libgdal-devel libgta-devel ffmpeg6-devel xine-lib-devel SDL2-devel gst-plugins-base1-devel $(vopt_if openexr libopenexr-devel) $(vopt_if poppler poppler-glib-devel) From d5ad92016df9e4cb4bdc2d1a26d9fc9d5bcbf6bc Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 30 Aug 2023 09:12:09 -0400 Subject: [PATCH 10/25] openmw: revbump for ffmpeg6 --- srcpkgs/openmw/patches/musl-cstdint.patch | 70 +++++++++++++++++++++++ srcpkgs/openmw/template | 4 +- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/openmw/patches/musl-cstdint.patch diff --git a/srcpkgs/openmw/patches/musl-cstdint.patch b/srcpkgs/openmw/patches/musl-cstdint.patch new file mode 100644 index 00000000000000..ee4764aa8c3858 --- /dev/null +++ b/srcpkgs/openmw/patches/musl-cstdint.patch @@ -0,0 +1,70 @@ +--- a/apps/openmw/mwgui/controllers.hpp ++++ b/apps/openmw/mwgui/controllers.hpp +@@ -1,6 +1,7 @@ + #ifndef MWGUI_CONTROLLERS_H + #define MWGUI_CONTROLLERS_H + ++#include + #include + #include + +--- a/apps/openmw/mwgui/itemselection.hpp ++++ b/apps/openmw/mwgui/itemselection.hpp +@@ -1,6 +1,7 @@ + #ifndef OPENMW_GAME_MWGUI_ITEMSELECTION_H + #define OPENMW_GAME_MWGUI_ITEMSELECTION_H + ++#include + #include + + #include "windowbase.hpp" +--- a/apps/openmw/mwgui/timeadvancer.hpp ++++ b/apps/openmw/mwgui/timeadvancer.hpp +@@ -1,6 +1,7 @@ + #ifndef MWGUI_TIMEADVANCER_H + #define MWGUI_TIMEADVANCER_H + ++#include + #include + + namespace MWGui + +--- a/apps/openmw/mwgui/widgets.hpp ++++ b/apps/openmw/mwgui/widgets.hpp +@@ -1,6 +1,7 @@ + #ifndef MWGUI_WIDGETS_H + #define MWGUI_WIDGETS_H + ++#include + #include "../mwmechanics/stat.hpp" + + #include +--- a/apps/openmw/mwinput/controlswitch.hpp ++++ b/apps/openmw/mwinput/controlswitch.hpp +@@ -1,6 +1,7 @@ + #ifndef MWINPUT_CONTROLSWITCH_H + #define MWINPUT_CONTROLSWITCH_H + ++#include + #include + #include + +--- a/components/misc/utf8stream.hpp ++++ b/components/misc/utf8stream.hpp +@@ -1,6 +1,7 @@ + #ifndef MISC_UTF8ITER_HPP + #define MISC_UTF8ITER_HPP + ++#include + #include + #include + #include +--- a/components/myguiplatform/myguidatamanager.cpp ++++ b/components/myguiplatform/myguidatamanager.cpp +@@ -1,5 +1,6 @@ + #include "myguidatamanager.hpp" + ++#include + #include + #include + #include diff --git a/srcpkgs/openmw/template b/srcpkgs/openmw/template index e40f79079f281a..bb60da8895b5ba 100644 --- a/srcpkgs/openmw/template +++ b/srcpkgs/openmw/template @@ -1,7 +1,7 @@ # Template file for 'openmw' pkgname=openmw version=0.48.0 -revision=2 +revision=3 build_style=cmake _recast_commit=e75adf86f91eb3082220085e42dda62679f9a3ea _bullet_tag=3.17 @@ -10,7 +10,7 @@ _bullet_tag=3.17 configure_args="-DDESIRED_QT_VERSION=5 -DOPENMW_USE_SYSTEM_BULLET=OFF -DOPENMW_LTO_BUILD=ON -DFETCHCONTENT_FULLY_DISCONNECTED=On" hostmakedepends="pkg-config qt5-host-tools qt5-qmake" -makedepends="SDL2-devel boost-devel ffmpeg-devel libXt-devel +makedepends="SDL2-devel boost-devel ffmpeg6-devel libXt-devel libmygui-devel libopenal-devel libunshield-devel osg-devel qt5-devel liblz4-devel yaml-cpp-devel LuaJIT-devel" short_desc="Open Implementation of Morrowind's Engine" From a3ef2e3393ed03d232f20dd14fd30f148b67bd96 Mon Sep 17 00:00:00 2001 From: zlice Date: Sun, 15 Oct 2023 21:18:36 -0400 Subject: [PATCH 11/25] sumo: revbump for ffmpeg6 --- srcpkgs/sumo/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/sumo/template b/srcpkgs/sumo/template index a730afa9fafa92..f5475ac9b5c00a 100644 --- a/srcpkgs/sumo/template +++ b/srcpkgs/sumo/template @@ -1,10 +1,10 @@ # Template file for 'sumo' pkgname=sumo version=1.12.0 -revision=7 +revision=8 build_style=cmake hostmakedepends="libgdal-tools pkg-config swig python3-setuptools" -makedepends="python3-devel ffmpeg-devel fox-devel gl2ps-devel libgdal-devel +makedepends="python3-devel ffmpeg6-devel fox-devel gl2ps-devel libgdal-devel libxerces-c-devel osg-devel proj-devel" short_desc="SUMO (Simulation of Urban MObility) and included applications" maintainer="Warrior Graph " From b08274fe512f2416d9ab6b62a7c1dc30cdcbd0dc Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:52 -0400 Subject: [PATCH 12/25] vice: revbump for ffmpeg6 --- srcpkgs/vice/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/vice/template b/srcpkgs/vice/template index 1c641d9ae9be22..052fa1eecc6268 100644 --- a/srcpkgs/vice/template +++ b/srcpkgs/vice/template @@ -1,7 +1,7 @@ # Template file for 'vice' pkgname=vice version=3.8 -revision=1 +revision=2 build_style=gnu-configure configure_args="--enable-cpuhistory --enable-x64 --disable-pdf-docs --libdir=/usr/lib$XBPS_TARGET_WORDSIZE $(vopt_enable sdl2 sdlui2) @@ -12,7 +12,7 @@ hostmakedepends="pkg-config flex dos2unix xa perl glib-devel xdg-utils" makedepends="zlib-devel readline-devel libpng-devel glew-devel alsa-lib-devel libcurl-devel $(vopt_if sdl2 SDL2_mixer-devel) $(vopt_if sdl2 SDL2-devel) $(vopt_if gtk3 gtk+3-devel) $(vopt_if gtk3 pulseaudio-devel) - $(vopt_if ffmpeg ffmpeg-devel)" + $(vopt_if ffmpeg ffmpeg6-devel)" short_desc="Emulator for C64, C128, CBM-II, PET, VIC20, Plus4 and C16" maintainer="Orphaned " license="GPL-2.0-or-later" From 820582a3dd325993cb6b76d1cc5739fa582bba21 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:51 -0400 Subject: [PATCH 13/25] retroarch: revbump for ffmpeg6 --- srcpkgs/retroarch/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/retroarch/template b/srcpkgs/retroarch/template index 2bbd93ce75cef1..072d719ce28059 100644 --- a/srcpkgs/retroarch/template +++ b/srcpkgs/retroarch/template @@ -1,7 +1,7 @@ # Template file for 'retroarch' pkgname=retroarch version=1.19.1 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking --enable-udev --disable-builtinflac --disable-builtinglslang @@ -12,7 +12,7 @@ configure_args="--prefix=/usr --sysconfdir=/etc --enable-networking conf_files="/etc/retroarch.cfg" hostmakedepends="pkg-config" makedepends="alsa-lib-devel eudev-libudev-devel freetype-devel libusb-devel libxkbcommon-devel - mbedtls-devel zlib-devel $(vopt_if ffmpeg ffmpeg-devel) $(vopt_if flac libflac-devel) + mbedtls-devel zlib-devel $(vopt_if ffmpeg ffmpeg6-devel) $(vopt_if flac libflac-devel) $(vopt_if glslang 'glslang-devel SPIRV-Tools-devel') $(vopt_if jack jack-devel) $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if qt5 qt5-devel) $(vopt_if sdl2 SDL2-devel) $(vopt_if vulkan vulkan-loader-devel) From 12ec865616d15b3a6c4dc68e2b5b5d9030bff155 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:50 -0400 Subject: [PATCH 14/25] ppsspp: revbump for ffmpeg6 --- srcpkgs/ppsspp/patches/ffmpeg6.patch | 15 +++++++++++++++ srcpkgs/ppsspp/template | 5 ++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/ppsspp/patches/ffmpeg6.patch diff --git a/srcpkgs/ppsspp/patches/ffmpeg6.patch b/srcpkgs/ppsspp/patches/ffmpeg6.patch new file mode 100644 index 00000000000000..5803c7bf227309 --- /dev/null +++ b/srcpkgs/ppsspp/patches/ffmpeg6.patch @@ -0,0 +1,15 @@ +--- a/Core/HW/SimpleAudioDec.cpp 2024-02-04 08:08:02.000000000 -0500 ++++ b/Core/HW/SimpleAudioDec.cpp 2024-02-15 14:48:27.114362051 -0500 +@@ -81,7 +81,11 @@ + return; + } + // Find decoder ++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 18, 100) + codec_ = avcodec_find_decoder((AVCodecID)audioCodecId); ++#else // this is a macro to const in the header ++ codec_ = (AVCodec*)avcodec_find_decoder((AVCodecID)audioCodecId); ++#endif + if (!codec_) { + // Eh, we shouldn't even have managed to compile. But meh. + ERROR_LOG(ME, "This version of FFMPEG does not support AV_CODEC_ctx for audio (%s). Update your submodule.", GetCodecName(audioType)); + diff --git a/srcpkgs/ppsspp/template b/srcpkgs/ppsspp/template index 2238a7601c0af8..e929fd18122c7c 100644 --- a/srcpkgs/ppsspp/template +++ b/srcpkgs/ppsspp/template @@ -1,7 +1,7 @@ # Template file for 'ppsspp' pkgname=ppsspp version=1.17.1 -revision=1 +revision=2 _glslang_commit=b34f619e1c85810dcb3c578107d2e48ba4ee2b37 _SPIRV_Cross_commit=4212eef67ed0ca048cb726a6767185504e7695e5 _armips_commit=a8d71f0f279eb0d30ecf6af51473b66ae0cf8e8d @@ -15,7 +15,7 @@ configure_args="-DHEADLESS=1 -DUSE_SYSTEM_FFMPEG=1 -DUNITTEST=ON -DUSING_QT_UI=$(vopt_if qt ON OFF) -DUSE_SYSTEM_ZSTD=ON -DARMIPS_USE_STD_FILESYSTEM=ON" hostmakedepends="pkg-config python3 $(vopt_if qt qt5-host-tools)" -makedepends="zlib-devel glew-devel ffmpeg-devel libzip-devel +makedepends="zlib-devel glew-devel ffmpeg6-devel libzip-devel snappy-devel rapidjson libpng-devel libzstd-devel $(vopt_if sdl2 'SDL2_ttf-devel SDL2-devel') wayland-devel $(vopt_if qt 'qt5-devel qt5-multimedia-devel')" @@ -91,7 +91,6 @@ post_configure() { } do_install() { - vlicense LICENSE.TXT vinstall icons/icon.svg 644 usr/share/pixmaps ppsspp.svg vinstall Qt/PPSSPP.desktop 644 usr/share/applications vbin build/PPSSPPHeadless ppsspp-headless From 883aec192758493fd7e686927d25095fbb957a06 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:48 -0400 Subject: [PATCH 15/25] hedgewars: revbump for ffmpeg6 --- .../0001-Add-support-for-ffmpeg-6.0.patch | 459 ++++++++++++++++++ srcpkgs/hedgewars/patches/i686.patch | 9 + srcpkgs/hedgewars/template | 12 +- 3 files changed, 475 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/hedgewars/patches/0001-Add-support-for-ffmpeg-6.0.patch create mode 100644 srcpkgs/hedgewars/patches/i686.patch diff --git a/srcpkgs/hedgewars/patches/0001-Add-support-for-ffmpeg-6.0.patch b/srcpkgs/hedgewars/patches/0001-Add-support-for-ffmpeg-6.0.patch new file mode 100644 index 00000000000000..228f329fc3802e --- /dev/null +++ b/srcpkgs/hedgewars/patches/0001-Add-support-for-ffmpeg-6.0.patch @@ -0,0 +1,459 @@ +From 71691fad8654031328f4af077fc32aaf29cdb7d0 Mon Sep 17 00:00:00 2001 +From: Pekka Ristola +Date: Tue, 9 May 2023 20:11:47 +0300 +Subject: [PATCH] Add support for ffmpeg 6.0 + +- Use the new send_frame/receive_packet API for encoding +- Use the new channel layout API for audio +- Fix audio recording + - Copy codec parameters to the stream parameters + - Set correct pts for audio frames +- Read audio samples from file directly to the refcounted AVFrame buffer instead of the `g_pSamples` buffer +- Use global AVPackets allocated with `av_packet_alloc` +- Stop trying to write more audio frames when `WriteAudioFrame` fails with a negative error code +- Fix segfault with `g_pContainer->url`. The field has to be allocated with `av_malloc` before writing to it. It's set to `NULL` by default. +- Properly free allocations with `avcodec_free_context` and `avformat_free_context` +--- + hedgewars/avwrapper/avwrapper.c | 234 +++++++++++++++++++++++++++----- + 1 file changed, 203 insertions(+), 31 deletions(-) + +diff --git a/hedgewars/avwrapper/avwrapper.c b/hedgewars/avwrapper/avwrapper.c +index 6c0fe739b..3daeb07b7 100644 +--- a/hedgewars/avwrapper/avwrapper.c ++++ b/hedgewars/avwrapper/avwrapper.c +@@ -42,15 +42,19 @@ + #define UNUSED(x) (void)(x) + + static AVFormatContext* g_pContainer; +-static AVOutputFormat* g_pFormat; ++static const AVOutputFormat* g_pFormat; + static AVStream* g_pAStream; + static AVStream* g_pVStream; + static AVFrame* g_pAFrame; + static AVFrame* g_pVFrame; +-static AVCodec* g_pACodec; +-static AVCodec* g_pVCodec; ++static const AVCodec* g_pACodec; ++static const AVCodec* g_pVCodec; + static AVCodecContext* g_pAudio; + static AVCodecContext* g_pVideo; ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++static AVPacket* g_pAPacket; ++static AVPacket* g_pVPacket; ++#endif + + static int g_Width, g_Height; + static uint32_t g_Frequency, g_Channels; +@@ -58,8 +62,13 @@ static int g_VQuality; + static AVRational g_Framerate; + + static FILE* g_pSoundFile; ++#if LIBAVUTIL_VERSION_MAJOR < 53 + static int16_t* g_pSamples; ++#endif + static int g_NumSamples; ++#if LIBAVCODEC_VERSION_MAJOR >= 53 ++static int64_t g_NextAudioPts; ++#endif + + + // compatibility section +@@ -93,6 +102,8 @@ static void rescale_ts(AVPacket *pkt, AVRational ctb, AVRational stb) + if (pkt->duration > 0) + pkt->duration = av_rescale_q(pkt->duration, ctb, stb); + } ++ ++#define avcodec_free_context(ctx) do { avcodec_close(*ctx); av_freep(ctx); } while (0) + #endif + + #ifndef AV_CODEC_CAP_DELAY +@@ -165,8 +176,42 @@ static void Log(const char* pFmt, ...) + AddFileLogRaw(Buffer); + } + ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++static int EncodeAndWriteFrame( ++ const AVStream* pStream, ++ AVCodecContext* pCodecContext, ++ const AVFrame* pFrame, ++ AVPacket* pPacket) ++{ ++ int ret; ++ ++ ret = avcodec_send_frame(pCodecContext, pFrame); ++ if (ret < 0) ++ return FatalError("avcodec_send_frame failed: %d", ret); ++ while (1) ++ { ++ ret = avcodec_receive_packet(pCodecContext, pPacket); ++ if (ret == AVERROR(EAGAIN)) ++ return 1; ++ else if (ret == AVERROR_EOF) ++ return 0; ++ else if (ret < 0) ++ return FatalError("avcodec_receive_packet failed: %d", ret); ++ ++ av_packet_rescale_ts(pPacket, pCodecContext->time_base, pStream->time_base); ++ ++ // Write the compressed frame to the media file. ++ pPacket->stream_index = pStream->index; ++ ret = av_interleaved_write_frame(g_pContainer, pPacket); ++ if (ret != 0) ++ return FatalError("Error while writing frame: %d", ret); ++ } ++} ++#endif ++ + static void AddAudioStream() + { ++ int ret; + g_pAStream = avformat_new_stream(g_pContainer, g_pACodec); + if(!g_pAStream) + { +@@ -176,20 +221,44 @@ static void AddAudioStream() + g_pAStream->id = 1; + + #if LIBAVCODEC_VERSION_MAJOR >= 59 +- const AVCodec *audio_st_codec = avcodec_find_decoder(g_pAStream->codecpar->codec_id); +- g_pAudio = avcodec_alloc_context3(audio_st_codec); +- avcodec_parameters_to_context(g_pAudio, g_pAStream->codecpar); ++ g_pAudio = avcodec_alloc_context3(g_pACodec); + #else + g_pAudio = g_pAStream->codec; +-#endif + + avcodec_get_context_defaults3(g_pAudio, g_pACodec); + g_pAudio->codec_id = g_pACodec->id; ++#endif + + // put parameters + g_pAudio->sample_fmt = AV_SAMPLE_FMT_S16; + g_pAudio->sample_rate = g_Frequency; ++#if LIBAVCODEC_VERSION_MAJOR >= 60 ++ const AVChannelLayout* pChLayout = g_pACodec->ch_layouts; ++ if (pChLayout) ++ { ++ for (; pChLayout->nb_channels; pChLayout++) ++ { ++ if (pChLayout->nb_channels == g_Channels) ++ { ++ ret = av_channel_layout_copy(&g_pAudio->ch_layout, pChLayout); ++ if (ret != 0) ++ { ++ Log("Channel layout copy failed: %d\n", ret); ++ return; ++ } ++ break; ++ } ++ } ++ } ++ if (!g_pAudio->ch_layout.nb_channels) ++ { ++ // no suitable layout found ++ g_pAudio->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; ++ g_pAudio->ch_layout.nb_channels = g_Channels; ++ } ++#else + g_pAudio->channels = g_Channels; ++#endif + + // set time base as invers of sample rate + g_pAudio->time_base.den = g_pAStream->time_base.den = g_Frequency; +@@ -213,6 +282,15 @@ static void AddAudioStream() + return; + } + ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ ret = avcodec_parameters_from_context(g_pAStream->codecpar, g_pAudio); ++ if (ret < 0) ++ { ++ Log("Could not copy parameters from codec context: %d\n", ret); ++ return; ++ } ++#endif ++ + #if LIBAVCODEC_VERSION_MAJOR >= 54 + if (g_pACodec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) + #else +@@ -221,13 +299,46 @@ static void AddAudioStream() + g_NumSamples = 4096; + else + g_NumSamples = g_pAudio->frame_size; +- g_pSamples = (int16_t*)av_malloc(g_NumSamples*g_Channels*sizeof(int16_t)); + g_pAFrame = av_frame_alloc(); + if (!g_pAFrame) + { + Log("Could not allocate frame\n"); + return; + } ++#if LIBAVUTIL_VERSION_MAJOR >= 53 ++#if LIBAVCODEC_VERSION_MAJOR >= 60 ++ ret = av_channel_layout_copy(&g_pAFrame->ch_layout, &g_pAudio->ch_layout); ++ if (ret != 0) ++ { ++ Log("Channel layout copy for frame failed: %d\n", ret); ++ return; ++ } ++#else ++ g_pAFrame->channels = g_pAudio->channels; ++#endif ++ g_pAFrame->format = g_pAudio->sample_fmt; ++ g_pAFrame->sample_rate = g_pAudio->sample_rate; ++ g_pAFrame->nb_samples = g_NumSamples; ++ ret = av_frame_get_buffer(g_pAFrame, 1); ++ if (ret < 0) ++ { ++ Log("Failed to allocate frame buffer: %d\n", ret); ++ return; ++ } ++#else ++ g_pSamples = (int16_t*)av_malloc(g_NumSamples*g_Channels*sizeof(int16_t)); ++#endif ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ g_pAPacket = av_packet_alloc(); ++ if (!g_pAPacket) ++ { ++ Log("Could not allocate audio packet\n"); ++ return; ++ } ++#endif ++#if LIBAVCODEC_VERSION_MAJOR >= 53 ++ g_NextAudioPts = 0; ++#endif + } + + // returns non-zero if there is more sound, -1 in case of error +@@ -236,22 +347,46 @@ static int WriteAudioFrame() + if (!g_pAStream) + return 0; + +- AVPacket Packet; +- av_init_packet(&Packet); +- Packet.data = NULL; +- Packet.size = 0; ++ int ret; ++ int16_t* pData; ++#if LIBAVUTIL_VERSION_MAJOR >= 53 ++ ret = av_frame_make_writable(g_pAFrame); ++ if (ret < 0) ++ return FatalError("Could not make audio frame writable: %d", ret); ++ pData = (int16_t*) g_pAFrame->data[0]; ++#else ++ pData = g_pSamples; ++#endif + +- int NumSamples = fread(g_pSamples, 2*g_Channels, g_NumSamples, g_pSoundFile); ++ int NumSamples = fread(pData, 2*g_Channels, g_NumSamples, g_pSoundFile); + + #if LIBAVCODEC_VERSION_MAJOR >= 53 + AVFrame* pFrame = NULL; + if (NumSamples > 0) + { + g_pAFrame->nb_samples = NumSamples; ++ g_pAFrame->pts = g_NextAudioPts; ++ g_NextAudioPts += NumSamples; ++#if LIBAVUTIL_VERSION_MAJOR < 53 + avcodec_fill_audio_frame(g_pAFrame, g_Channels, AV_SAMPLE_FMT_S16, +- (uint8_t*)g_pSamples, NumSamples*2*g_Channels, 1); ++ (uint8_t*)pData, NumSamples*2*g_Channels, 1); ++#endif + pFrame = g_pAFrame; + } ++#endif ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ ret = EncodeAndWriteFrame(g_pAStream, g_pAudio, pFrame, g_pAPacket); ++ if (ret < 0) ++ return FatalError("Audio frame processing failed"); ++ return ret; ++#else ++ AVPacket Packet; ++ av_init_packet(&Packet); ++ Packet.data = NULL; ++ Packet.size = 0; ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 53 + // when NumSamples == 0 we still need to call encode_audio2 to flush + int got_packet; + if (avcodec_encode_audio2(g_pAudio, &Packet, pFrame, &got_packet) != 0) +@@ -266,7 +401,7 @@ static int WriteAudioFrame() + int BufferSize = OUTBUFFER_SIZE; + if (g_pAudio->frame_size == 0) + BufferSize = NumSamples*g_Channels*2; +- Packet.size = avcodec_encode_audio(g_pAudio, g_OutBuffer, BufferSize, g_pSamples); ++ Packet.size = avcodec_encode_audio(g_pAudio, g_OutBuffer, BufferSize, pData); + if (Packet.size == 0) + return 1; + if (g_pAudio->coded_frame && g_pAudio->coded_frame->pts != AV_NOPTS_VALUE) +@@ -280,25 +415,25 @@ static int WriteAudioFrame() + if (av_interleaved_write_frame(g_pContainer, &Packet) != 0) + return FatalError("Error while writing audio frame"); + return 1; ++#endif + } + + // add a video output stream + static int AddVideoStream() + { ++ int ret; + g_pVStream = avformat_new_stream(g_pContainer, g_pVCodec); + if (!g_pVStream) + return FatalError("Could not allocate video stream"); + + #if LIBAVCODEC_VERSION_MAJOR >= 59 +- const AVCodec *video_st_codec = avcodec_find_decoder(g_pVStream->codecpar->codec_id); +- g_pVideo = avcodec_alloc_context3(video_st_codec); +- avcodec_parameters_to_context(g_pVideo, g_pVStream->codecpar); ++ g_pVideo = avcodec_alloc_context3(g_pVCodec); + #else + g_pVideo = g_pVStream->codec; +-#endif + + avcodec_get_context_defaults3(g_pVideo, g_pVCodec); + g_pVideo->codec_id = g_pVCodec->id; ++#endif + + // put parameters + // resolution must be a multiple of two +@@ -361,6 +496,12 @@ static int AddVideoStream() + if (avcodec_open2(g_pVideo, g_pVCodec, NULL) < 0) + return FatalError("Could not open video codec %s", g_pVCodec->long_name); + ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ ret = avcodec_parameters_from_context(g_pVStream->codecpar, g_pVideo); ++ if (ret < 0) ++ return FatalError("Could not copy parameters from codec context: %d", ret); ++#endif ++ + g_pVFrame = av_frame_alloc(); + if (!g_pVFrame) + return FatalError("Could not allocate frame"); +@@ -370,6 +511,12 @@ static int AddVideoStream() + g_pVFrame->height = g_Height; + g_pVFrame->format = AV_PIX_FMT_YUV420P; + ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ g_pVPacket = av_packet_alloc(); ++ if (!g_pVPacket) ++ return FatalError("Could not allocate packet"); ++#endif ++ + return avcodec_default_get_buffer2(g_pVideo, g_pVFrame, 0); + } + +@@ -380,6 +527,10 @@ static int WriteFrame(AVFrame* pFrame) + // write interleaved audio frame + if (g_pAStream) + { ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ if (!g_pAPacket) ++ return FatalError("Error while writing video frame: g_pAPacket does not exist"); ++#endif + VideoTime = (double)g_pVFrame->pts * g_pVStream->time_base.num/g_pVStream->time_base.den; + do + { +@@ -388,7 +539,7 @@ static int WriteFrame(AVFrame* pFrame) + AudioTime = (double)g_pAFrame->pts * g_pAStream->time_base.num/g_pAStream->time_base.den; + ret = WriteAudioFrame(); + } +- while (AudioTime < VideoTime && ret); ++ while (AudioTime < VideoTime && ret > 0); + if (ret < 0) + return ret; + } +@@ -396,13 +547,18 @@ static int WriteFrame(AVFrame* pFrame) + if (!g_pVStream) + return 0; + ++ g_pVFrame->pts++; ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ ret = EncodeAndWriteFrame(g_pVStream, g_pVideo, pFrame, g_pVPacket); ++ if (ret < 0) ++ return FatalError("Video frame processing failed"); ++ return ret; ++#else + AVPacket Packet; + av_init_packet(&Packet); + Packet.data = NULL; + Packet.size = 0; + +- g_pVFrame->pts++; +-#if LIBAVCODEC_VERSION_MAJOR < 58 + if (g_pFormat->flags & AVFMT_RAWPICTURE) + { + /* raw video case. The API will change slightly in the near +@@ -417,7 +573,6 @@ static int WriteFrame(AVFrame* pFrame) + return 0; + } + else +-#endif + { + #if LIBAVCODEC_VERSION_MAJOR >= 54 + int got_packet; +@@ -447,6 +602,7 @@ static int WriteFrame(AVFrame* pFrame) + + return 1; + } ++#endif + } + + AVWRAP_DECL int AVWrapper_WriteFrame(uint8_t *buf) +@@ -539,9 +695,13 @@ AVWRAP_DECL int AVWrapper_Init( + char ext[16]; + strncpy(ext, g_pFormat->extensions, 16); + ext[15] = 0; +- ext[strcspn(ext,",")] = 0; ++ size_t extLen = strcspn(ext, ","); ++ ext[extLen] = 0; + #if LIBAVCODEC_VERSION_MAJOR >= 59 +- snprintf(g_pContainer->url, sizeof(g_pContainer->url), "%s.%s", pFilename, ext); ++ // pFilename + dot + ext + null byte ++ size_t urlLen = strlen(pFilename) + 1 + extLen + 1; ++ g_pContainer->url = av_malloc(urlLen); ++ snprintf(g_pContainer->url, urlLen, "%s.%s", pFilename, ext); + #else + snprintf(g_pContainer->filename, sizeof(g_pContainer->filename), "%s.%s", pFilename, ext); + #endif +@@ -636,21 +796,33 @@ AVWRAP_DECL int AVWrapper_Close() + // free everything + if (g_pVStream) + { +- avcodec_close(g_pVideo); +- av_free(g_pVideo); +- av_free(g_pVStream); ++ avcodec_free_context(&g_pVideo); + av_frame_free(&g_pVFrame); ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ av_packet_free(&g_pVPacket); ++#endif + } + if (g_pAStream) + { +- avcodec_close(g_pAudio); +- av_free(g_pAudio); +- av_free(g_pAStream); ++ avcodec_free_context(&g_pAudio); + av_frame_free(&g_pAFrame); ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ av_packet_free(&g_pAPacket); ++#endif ++#if LIBAVUTIL_VERSION_MAJOR < 53 + av_free(g_pSamples); ++#endif + fclose(g_pSoundFile); + } + ++#if LIBAVCODEC_VERSION_MAJOR >= 59 ++ avformat_free_context(g_pContainer); ++#else ++ if (g_pVStream) ++ av_free(g_pVStream); ++ if (g_pAStream) ++ av_free(g_pAStream); + av_free(g_pContainer); ++#endif + return 0; + } +-- +2.45.2 + diff --git a/srcpkgs/hedgewars/patches/i686.patch b/srcpkgs/hedgewars/patches/i686.patch new file mode 100644 index 00000000000000..75a90d988e033c --- /dev/null +++ b/srcpkgs/hedgewars/patches/i686.patch @@ -0,0 +1,9 @@ +--- a/project_files/hwc/rtl/GL.h ++++ b/project_files/hwc/rtl/GL.h +@@ -3,6 +3,7 @@ + #if defined(__APPLE__) && !defined(EMSCRIPTEN) + #include + #else ++#include "GL/glew.h" + #include "GL/gl.h" + #endif diff --git a/srcpkgs/hedgewars/template b/srcpkgs/hedgewars/template index 8dd0e4252ca8c5..ab8ded8aca7c8c 100644 --- a/srcpkgs/hedgewars/template +++ b/srcpkgs/hedgewars/template @@ -1,13 +1,13 @@ # Template file for 'hedgewars' pkgname=hedgewars version=1.0.2 -revision=1 +revision=2 build_style=cmake configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname} -DPHYSFS_SYSTEM=1 -DMINIMAL_FLAGS=1" make_cmd=make hostmakedepends="lua51 pkg-config qt5-qmake qt5-host-tools" -makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel +makedepends="ffmpeg6-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel" depends="libfreeglut" short_desc="Funny turn-based artillery game, featuring fighting Hedgehogs!" @@ -28,7 +28,7 @@ case $XBPS_TARGET_MACHINE in *) # use C engine for architectures lacking freepascal support # https://www.hedgewars.org/kb/pas2CTutorial - # i686 has a 32 bit freepascal bug + # i686 has a 32 bit freepascal bug - CMakeLists.txt:83 # https://travis-ci.org/void-linux/void-packages/jobs/596458977#L4316 _use_c_engine=1 ;; @@ -44,8 +44,10 @@ fi pre_configure() { if [ -n "$_use_c_engine" ]; then # remove option not supported by clang - CFLAGS=${CFLAGS/-fstack-clash-protection/} - CXXFLAGS=${CXXFLAGS/-fstack-clash-protection/} + # pointer convert - project_files/hwc/rtl/sysutils.c:86:32 + # i686 not linking GLEW anymore. throws warnings everywhere but links + CFLAGS="${CFLAGS/-fstack-clash-protection/} -Wno-int-conversion -lGLEW" + CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/} -Wno-int-conversion -lGLEW" fi } From 782e30df326e98189c867aaf9a6f0daf255f2be8 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:48 -0400 Subject: [PATCH 16/25] mgba: revbump for ffmpeg6 --- srcpkgs/mgba/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/mgba/template b/srcpkgs/mgba/template index 6cd65650312543..c2d39cd17d86bc 100644 --- a/srcpkgs/mgba/template +++ b/srcpkgs/mgba/template @@ -1,10 +1,10 @@ # Template file for 'mgba' pkgname=mgba version=0.10.3 -revision=1 +revision=2 build_style=cmake hostmakedepends="pkg-config qt5-host-tools qt5-qmake desktop-file-utils" -makedepends="SDL2-devel ffmpeg-devel libedit-devel libepoxy-devel libmagick-devel +makedepends="SDL2-devel ffmpeg6-devel libedit-devel libepoxy-devel libmagick-devel libzip-devel qt5-multimedia-devel qt5-tools-devel" short_desc="Game Boy Advance emulator written in C" maintainer="fanyx " From 608be3526dfe72d252f758b82630c92d255b5c8a Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:47 -0400 Subject: [PATCH 17/25] goldendict: revbump for ffmpeg6 --- srcpkgs/goldendict/template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcpkgs/goldendict/template b/srcpkgs/goldendict/template index f4a05759f693d3..400a0e44f2a9de 100644 --- a/srcpkgs/goldendict/template +++ b/srcpkgs/goldendict/template @@ -1,16 +1,16 @@ # Template file for 'goldendict' pkgname=goldendict version=1.5.0 -revision=1 +revision=2 build_style=qmake configure_args="CONFIG+=zim_support goldendict.pro" hostmakedepends="qt5-qmake pkg-config qt5-host-tools" makedepends="tiff-devel qt5-devel libvorbis-devel zlib-devel libXtst-devel hunspell-devel qt5-tools-devel qt5-declarative-devel qt5-webkit-devel lzo-devel bzip2-devel libao-devel qt5-svg-devel - libeb-devel qt5-x11extras-devel ffmpeg-devel liblzma-devel + libeb-devel qt5-x11extras-devel ffmpeg6-devel liblzma-devel qt5-multimedia-devel" -short_desc="A feature-rich dictionary lookup program" +short_desc="Feature-rich dictionary lookup program" maintainer="John " license="GPL-3.0-or-later" homepage="http://goldendict.org/" From f15c686f5f7be5dc863b865cf2adb09339f85666 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:48 -0400 Subject: [PATCH 18/25] kpipewire: revbump for ffmpeg6 --- srcpkgs/kpipewire/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/kpipewire/template b/srcpkgs/kpipewire/template index 1244d60416e1ed..c64676069db1b1 100644 --- a/srcpkgs/kpipewire/template +++ b/srcpkgs/kpipewire/template @@ -1,12 +1,12 @@ # Template file for 'kpipewire' pkgname=kpipewire version=6.1.3 -revision=1 +revision=2 build_style=cmake configure_args="-DKDE_INSTALL_QMLDIR=lib/qt6/qml" hostmakedepends="extra-cmake-modules gettext qt6-base qt6-tools pkg-config pipewire qt6-wayland-tools wayland-devel qt6-declarative-host-tools" -makedepends="ffmpeg-devel kf6-kcoreaddons-devel kf6-kwayland-devel +makedepends="ffmpeg6-devel kf6-kcoreaddons-devel kf6-kwayland-devel kf6-ki18n-devel libva-devel libepoxy-devel pipewire-devel qt6-wayland-devel plasma-wayland-protocols wayland-devel qt6-declarative-devel qt6-base-private-devel" From 676112913b24b62020d066cc17ce468ef8d206b2 Mon Sep 17 00:00:00 2001 From: zlice Date: Mon, 20 Nov 2023 18:00:36 -0500 Subject: [PATCH 19/25] kfilemetadata5: revbump for ffmpeg6 --- srcpkgs/kfilemetadata5/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/kfilemetadata5/template b/srcpkgs/kfilemetadata5/template index a0c4d809395323..51450e80a620fc 100644 --- a/srcpkgs/kfilemetadata5/template +++ b/srcpkgs/kfilemetadata5/template @@ -1,12 +1,12 @@ # Template file for 'kfilemetadata5' pkgname=kfilemetadata5 version=5.115.0 -revision=1 +revision=2 build_style=cmake hostmakedepends="kcoreaddons extra-cmake-modules pkg-config qt5-host-tools qt5-qmake gettext kcoreaddons python3" makedepends="karchive-devel ki18n-devel poppler-qt5-devel kcoreaddons-devel - taglib-devel exiv2-devel ffmpeg-devel attr-devel ebook-tools-devel + taglib-devel exiv2-devel ffmpeg6-devel attr-devel ebook-tools-devel libqmobipocket-devel" short_desc="Simple library for extracting the text and metadata" maintainer="John " From 8921a190c8c2660537c7420a2d875275fa167563 Mon Sep 17 00:00:00 2001 From: zlice Date: Tue, 4 Jun 2024 09:05:18 -0400 Subject: [PATCH 20/25] kf6-kfilemetadata: revbump for ffmpeg6 --- srcpkgs/kf6-kfilemetadata/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/kf6-kfilemetadata/template b/srcpkgs/kf6-kfilemetadata/template index e16935aa52b51b..154b134a46e437 100644 --- a/srcpkgs/kf6-kfilemetadata/template +++ b/srcpkgs/kf6-kfilemetadata/template @@ -1,14 +1,14 @@ # Template file for 'kf6-kfilemetadata' pkgname=kf6-kfilemetadata version=6.3.0 -revision=1 +revision=2 build_style=cmake configure_args="-DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins" hostmakedepends="extra-cmake-modules qt6-tools qt6-base gettext pkg-config" makedepends="qt6-base-devel kf6-kcodecs-devel kf6-ki18n-devel kf6-karchive-devel kf6-kcoreaddons-devel kf6-kconfig-devel attr-devel taglib-devel libqmobipocket6-devel - exiv2-devel ffmpeg-devel ebook-tools-devel poppler-qt6-devel" + exiv2-devel ffmpeg6-devel ebook-tools-devel poppler-qt6-devel" short_desc="Library for extracting file metadata" maintainer="John " license="LGPL-2.1-or-later" From 87f1c98e8372f882d2bbc36d90e67ac763440a9b Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 24 Jul 2024 12:56:33 -0400 Subject: [PATCH 21/25] kf6-kcoreadds: revbump for kf6-kfilemetadata for some reason do_check is segfaulting in kf6-kfilemetadata. revbumping this seems to fix it --- srcpkgs/kf6-kcoreaddons/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/kf6-kcoreaddons/template b/srcpkgs/kf6-kcoreaddons/template index e3fdd0c7a8a527..2a4c51a4173059 100644 --- a/srcpkgs/kf6-kcoreaddons/template +++ b/srcpkgs/kf6-kcoreaddons/template @@ -1,7 +1,7 @@ # Template file for 'kf6-kcoreaddons' pkgname=kf6-kcoreaddons version=6.3.0 -revision=1 +revision=2 build_style=cmake configure_args="-DKDE_INSTALL_QMLDIR=lib/qt6/qml -DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins" From 22495235a09ea99c39d65b7a4b9280de7c34477b Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:51 -0400 Subject: [PATCH 22/25] ssr: revbump for ffmpeg6 --- .../0001-Fix-build-with-ffmpeg-5.0.patch | 241 ++++++++++++++++++ srcpkgs/ssr/template | 4 +- 2 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/ssr/patches/0001-Fix-build-with-ffmpeg-5.0.patch diff --git a/srcpkgs/ssr/patches/0001-Fix-build-with-ffmpeg-5.0.patch b/srcpkgs/ssr/patches/0001-Fix-build-with-ffmpeg-5.0.patch new file mode 100644 index 00000000000000..4c069b5a9fc464 --- /dev/null +++ b/srcpkgs/ssr/patches/0001-Fix-build-with-ffmpeg-5.0.patch @@ -0,0 +1,241 @@ +From f4cbde38021d9330dc73d2e3dfa8a70da3ff5721 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +Date: Sun, 16 Jan 2022 02:40:04 +0100 +Subject: [PATCH] Fix build with ffmpeg 5.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Adapt to ffmpeg 5.0 requiring more const-ness for AVCodec. + +Signed-off-by: Bernhard Rosenkränzer +--- + src/AV/Output/AudioEncoder.cpp | 6 +++--- + src/AV/Output/AudioEncoder.h | 4 ++-- + src/AV/Output/BaseEncoder.cpp | 4 ++-- + src/AV/Output/BaseEncoder.h | 4 ++-- + src/AV/Output/Muxer.cpp | 12 ++++++------ + src/AV/Output/Muxer.h | 4 ++-- + src/AV/Output/VideoEncoder.cpp | 6 +++--- + src/AV/Output/VideoEncoder.h | 4 ++-- + 8 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/src/AV/Output/AudioEncoder.cpp b/src/AV/Output/AudioEncoder.cpp +index 34d015c..cefc2e0 100644 +--- a/src/AV/Output/AudioEncoder.cpp ++++ b/src/AV/Output/AudioEncoder.cpp +@@ -34,7 +34,7 @@ const std::vector AudioEncoder::SUPPORTED_SAMPLE + + const unsigned int AudioEncoder::DEFAULT_FRAME_SAMPLES = 1024; + +-AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, AVCodec* codec, AVDictionary** options) ++AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, const AVCodec* codec, AVDictionary** options) + : BaseEncoder(muxer, stream, codec_context, codec, options) { + + #if !SSR_USE_AVCODEC_ENCODE_AUDIO2 +@@ -77,7 +77,7 @@ unsigned int AudioEncoder::GetSampleRate() { + } + + bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) + return false; + if(!av_codec_is_encoder(codec)) +@@ -93,7 +93,7 @@ bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) { + return false; + } + +-void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, ++void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) { + + if(channels == 0) { +diff --git a/src/AV/Output/AudioEncoder.h b/src/AV/Output/AudioEncoder.h +index c93278c..ae9c82e 100644 +--- a/src/AV/Output/AudioEncoder.h ++++ b/src/AV/Output/AudioEncoder.h +@@ -40,7 +40,7 @@ private: + #endif + + public: +- AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + ~AudioEncoder(); + + // Returns the required frame size, i.e. the number of samples (for each channel). +@@ -57,7 +57,7 @@ public: + + public: + static bool AVCodecIsSupported(const QString& codec_name); +- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, ++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate); + + private: +diff --git a/src/AV/Output/BaseEncoder.cpp b/src/AV/Output/BaseEncoder.cpp +index 7c01ef3..4780aaf 100644 +--- a/src/AV/Output/BaseEncoder.cpp ++++ b/src/AV/Output/BaseEncoder.cpp +@@ -42,7 +42,7 @@ double ParseCodecOptionDouble(const QString& key, const QString& value, double m + return clamp(value_double, min, max) * multiply; + } + +-BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options) { ++BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options) { + + m_muxer = muxer; + m_stream = stream; +@@ -157,7 +157,7 @@ void BaseEncoder::IncrementPacketCounter() { + ++lock->m_total_packets; + } + +-void BaseEncoder::Init(AVCodec* codec, AVDictionary** options) { ++void BaseEncoder::Init(const AVCodec* codec, AVDictionary** options) { + + // open codec + if(avcodec_open2(m_codec_context, codec, options) < 0) { +diff --git a/src/AV/Output/BaseEncoder.h b/src/AV/Output/BaseEncoder.h +index 3d92f29..7f02bbd 100644 +--- a/src/AV/Output/BaseEncoder.h ++++ b/src/AV/Output/BaseEncoder.h +@@ -51,7 +51,7 @@ private: + std::atomic m_should_stop, m_should_finish, m_is_done, m_error_occurred; + + protected: +- BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + + public: + virtual ~BaseEncoder(); // encoders will be deleted by Muxer, don't delete them yourself! +@@ -117,7 +117,7 @@ protected: + void IncrementPacketCounter(); + + private: +- void Init(AVCodec* codec, AVDictionary** options); ++ void Init(const AVCodec* codec, AVDictionary** options); + void Free(); + + void EncoderThread(); +diff --git a/src/AV/Output/Muxer.cpp b/src/AV/Output/Muxer.cpp +index ad58380..14650b0 100644 +--- a/src/AV/Output/Muxer.cpp ++++ b/src/AV/Output/Muxer.cpp +@@ -87,7 +87,7 @@ Muxer::~Muxer() { + + VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) { +- AVCodec *codec = FindCodec(codec_name); ++ const AVCodec *codec = FindCodec(codec_name); + AVCodecContext *codec_context = NULL; + AVStream *stream = AddStream(codec, &codec_context); + VideoEncoder *encoder; +@@ -111,7 +111,7 @@ VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vecto + + AudioEncoder* Muxer::AddAudioEncoder(const QString& codec_name, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) { +- AVCodec *codec = FindCodec(codec_name); ++ const AVCodec *codec = FindCodec(codec_name); + AVCodecContext *codec_context = NULL; + AVStream *stream = AddStream(codec, &codec_context); + AudioEncoder *encoder; +@@ -194,7 +194,7 @@ unsigned int Muxer::GetQueuedPacketCount(unsigned int stream_index) { + void Muxer::Init() { + + // get the format we want (this is just a pointer, we don't have to free this) +- AVOutputFormat *format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL); ++ const AVOutputFormat *format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL); + if(format == NULL) { + Logger::LogError("[Muxer::Init] " + Logger::tr("Error: Can't find chosen output format!")); + throw LibavException(); +@@ -261,8 +261,8 @@ void Muxer::Free() { + } + } + +-AVCodec* Muxer::FindCodec(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++const AVCodec* Muxer::FindCodec(const QString& codec_name) { ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) { + Logger::LogError("[Muxer::FindCodec] " + Logger::tr("Error: Can't find codec!")); + throw LibavException(); +@@ -270,7 +270,7 @@ AVCodec* Muxer::FindCodec(const QString& codec_name) { + return codec; + } + +-AVStream* Muxer::AddStream(AVCodec* codec, AVCodecContext** codec_context) { ++AVStream* Muxer::AddStream(const AVCodec* codec, AVCodecContext** codec_context) { + assert(!m_started); + assert(m_format_context->nb_streams < MUXER_MAX_STREAMS); + +diff --git a/src/AV/Output/Muxer.h b/src/AV/Output/Muxer.h +index d72347d..b104bcb 100644 +--- a/src/AV/Output/Muxer.h ++++ b/src/AV/Output/Muxer.h +@@ -114,8 +114,8 @@ private: + void Init(); + void Free(); + +- AVCodec* FindCodec(const QString& codec_name); +- AVStream* AddStream(AVCodec* codec, AVCodecContext** codec_context); ++ const AVCodec* FindCodec(const QString& codec_name); ++ AVStream* AddStream(const AVCodec* codec, AVCodecContext** codec_context); + + void MuxerThread(); + +diff --git a/src/AV/Output/VideoEncoder.cpp b/src/AV/Output/VideoEncoder.cpp +index 8087e8e..fc8b5d1 100644 +--- a/src/AV/Output/VideoEncoder.cpp ++++ b/src/AV/Output/VideoEncoder.cpp +@@ -34,7 +34,7 @@ const std::vector VideoEncoder::SUPPORTED_PIXEL_F + {"rgb", AV_PIX_FMT_RGB24, false}, + }; + +-VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options) ++VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options) + : BaseEncoder(muxer, stream, codec_context, codec, options) { + + #if !SSR_USE_AVCODEC_ENCODE_VIDEO2 +@@ -95,7 +95,7 @@ unsigned int VideoEncoder::GetFrameRate() { + } + + bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) + return false; + if(!av_codec_is_encoder(codec)) +@@ -111,7 +111,7 @@ bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) { + return false; + } + +-void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, ++void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) { + + if(width == 0 || height == 0) { +diff --git a/src/AV/Output/VideoEncoder.h b/src/AV/Output/VideoEncoder.h +index cb7ca27..68d872e 100644 +--- a/src/AV/Output/VideoEncoder.h ++++ b/src/AV/Output/VideoEncoder.h +@@ -40,7 +40,7 @@ private: + #endif + + public: +- VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + ~VideoEncoder(); + + // Returns the required pixel format. +@@ -55,7 +55,7 @@ public: + + public: + static bool AVCodecIsSupported(const QString& codec_name); +- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, ++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate); + + private: +-- +2.43.0 + diff --git a/srcpkgs/ssr/template b/srcpkgs/ssr/template index 3097754e3cbe54..5d5c0a98d65f58 100644 --- a/srcpkgs/ssr/template +++ b/srcpkgs/ssr/template @@ -1,11 +1,11 @@ # Template file for 'ssr' pkgname=ssr version=0.4.4 -revision=2 +revision=3 build_style=cmake configure_args="-DWITH_QT5=ON" hostmakedepends="pkg-config" -makedepends="alsa-lib-devel ffmpeg-devel glu-devel jack-devel pulseaudio-devel +makedepends="alsa-lib-devel ffmpeg6-devel glu-devel jack-devel pulseaudio-devel qt5-tools-devel qt5-x11extras-devel libXinerama-devel v4l-utils-devel" depends="desktop-file-utils hicolor-icon-theme" short_desc="Simple Screen Recorder for programs and games" From 8a59909036e1096c914adc66f531cecfeaa8e5a7 Mon Sep 17 00:00:00 2001 From: zlice Date: Fri, 10 Nov 2023 15:02:30 -0500 Subject: [PATCH 23/25] QMPlay2: revbump for ffmpeg6 --- srcpkgs/QMPlay2/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/QMPlay2/template b/srcpkgs/QMPlay2/template index 054b7bad0452f7..b58ef7c089bd4e 100644 --- a/srcpkgs/QMPlay2/template +++ b/srcpkgs/QMPlay2/template @@ -1,10 +1,10 @@ # Template file for 'QMPlay2' pkgname=QMPlay2 version=24.06.16 -revision=1 +revision=2 build_style=cmake hostmakedepends="pkg-config qt5-qmake qt5-host-tools" -makedepends="alsa-lib-devel ffmpeg-devel libass-devel libcdio-devel libgme-devel +makedepends="alsa-lib-devel ffmpeg6-devel libass-devel libcdio-devel libgme-devel libsidplayfp-devel libva-glx-devel libXv-devel pulseaudio-devel qt5-svg-devel qt5-tools-devel qt5-x11extras-devel taglib-devel libcdio-paranoia-devel qt5-declarative-devel" From c60f5b4c93822e11e9020cc5dc4a6708c1a359a0 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:45 -0400 Subject: [PATCH 24/25] audacious-plugins: revbump for ffmpeg6 --- .../audacious-plugins/patches/ffmpeg5.patch | 43 +++++++++++++++++++ srcpkgs/audacious-plugins/template | 4 +- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/audacious-plugins/patches/ffmpeg5.patch diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg5.patch b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch new file mode 100644 index 00000000000000..4e5e34099d71c4 --- /dev/null +++ b/srcpkgs/audacious-plugins/patches/ffmpeg5.patch @@ -0,0 +1,43 @@ +commit 298aa371c56c2f52c25a33d9bdec4918b11cebdc +Author: tibequadorian +Date: Sat Mar 19 18:40:12 2022 +0100 + + audacious-plugins: rebuild against ffmpeg-5.0 + +diff --git a/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch +new file mode 100644 +index 0000000000..617c11215b +--- /dev/null ++++ b/srcpkgs/audacious-plugins/patches/ffmpeg-5.0.patch +@@ -0,0 +1,31 @@ ++From f60beb400eeb1e4778bbfd738bc4a4ccef3de539 Mon Sep 17 00:00:00 2001 ++From: John Lindgren ++Date: Sat, 5 Mar 2022 12:05:34 -0500 ++Subject: [PATCH] Fix build with FFmpeg 5.0 ++ ++--- ++ src/ffaudio/ffaudio-core.cc | 4 ++-- ++ 1 file changed, 2 insertions(+), 2 deletions(-) ++ ++diff --git a/src/ffaudio/ffaudio-core.cc b/src/ffaudio/ffaudio-core.cc ++index 16dc63e3a..a2b95fd6c 100644 ++--- a/src/ffaudio/ffaudio-core.cc +++++ b/src/ffaudio/ffaudio-core.cc ++@@ -274,7 +274,7 @@ static AVInputFormat * get_format_by_content (const char * name, VFSFile & file) ++ AVProbeData d = {name, buf, filled}; ++ score = target; ++ ++- f = av_probe_input_format2 (& d, true, & score); +++ f = (AVInputFormat *) av_probe_input_format2 (& d, true, & score); ++ if (f) ++ break; ++ ++@@ -347,7 +347,7 @@ static bool find_codec (AVFormatContext * c, CodecInfo * cinfo) ++ #endif ++ if (stream && stream->codecpar && stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) ++ { ++- AVCodec * codec = avcodec_find_decoder (stream->codecpar->codec_id); +++ AVCodec * codec = (AVCodec *) avcodec_find_decoder (stream->codecpar->codec_id); ++ ++ if (codec) ++ { diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template index 4a67e362c3e91d..7a80c8c0bef675 100644 --- a/srcpkgs/audacious-plugins/template +++ b/srcpkgs/audacious-plugins/template @@ -2,12 +2,12 @@ # Keep in sync with audacious and audacious-base pkgname=audacious-plugins version=4.4 -revision=1 +revision=2 build_style=meson configure_args="$(vopt_bool gtk) $(vopt_bool qt)" hostmakedepends="gettext pkg-config glib-devel $(vopt_if qt qt6-tools)" makedepends="audacious-base-devel alsa-lib-devel pulseaudio-devel jack-devel - lame-devel libvorbis-devel libflac-devel mpg123-devel faad2-devel ffmpeg-devel + lame-devel libvorbis-devel libflac-devel mpg123-devel faad2-devel ffmpeg6-devel libmodplug-devel fluidsynth-devel libcdio-paranoia-devel wavpack-devel libnotify-devel libcurl-devel libmtp-devel neon-devel libmms-devel libxml2-devel opus-devel opusfile-devel libbs2b-devel libsoxr-devel libsidplayfp-devel libcue-devel libopenmpt-devel pipewire-devel From 216d45b67ff500f8404d3e7235765b0e4e3ae867 Mon Sep 17 00:00:00 2001 From: zlice Date: Wed, 22 Mar 2023 20:01:50 -0400 Subject: [PATCH 25/25] qmmp: revbump for ffmpeg6 --- srcpkgs/qmmp/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/qmmp/template b/srcpkgs/qmmp/template index 53781ea3bc28ad..e96175b05eaed6 100644 --- a/srcpkgs/qmmp/template +++ b/srcpkgs/qmmp/template @@ -1,12 +1,12 @@ # Template file for 'qmmp' pkgname=qmmp version=1.6.1 -revision=3 +revision=4 build_style=cmake configure_args="-DUSE_HAL:BOOL=FALSE -DQMMP_DEFAULT_UI:STRING=simple" hostmakedepends="pkg-config qt5-host-tools qt5-qmake" # XXX projectm -makedepends="enca-devel faad2-devel ffmpeg-devel jack-devel libarchive-devel +makedepends="enca-devel faad2-devel ffmpeg6-devel jack-devel libarchive-devel libbs2b-devel libcdio-paranoia-devel libcurl-devel libgme-devel libmad-devel libmms-devel libmodplug-devel libmpcdec-devel libsamplerate-devel libwildmidi-devel libshout-devel libsidplayfp-devel libsoxr-devel opusfile-devel pulseaudio-devel