moc: update to 2.6-alpha3

- use ffmpeg4
This commit is contained in:
Mohamed Akram
2026-05-15 17:59:33 +04:00
parent 016f16e193
commit f6ed7a0aaa
3 changed files with 59 additions and 144 deletions
+31 -19
View File
@@ -1,10 +1,11 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup ffmpeg 1.0
name moc
version 2.6-alpha1
revision 10
version 2.6-alpha3
revision 0
license GPL-2+
categories multimedia
maintainers nomaintainer
@@ -20,38 +21,54 @@ long_description MOC (music on console) is a console audio player for LINUX/U
homepage http://moc.daper.net
master_sites http://ftp.daper.net/pub/soft/moc/unstable/
checksums rmd160 283f9945abbd3b3d4e15f23485228c00983edfe8 \
sha256 0b0a3515c65b4c47a250e350c663535778239352db859921f5d564ed727a0bbc \
size 491660
checksums rmd160 d56a53b67438d397f309a1e07f42ac3b4b3550be \
sha256 a27b8888984cf8dbcd758584961529ddf48c237caa9b40b67423fbfbb88323b1 \
size 496676
use_xz yes
configure.cflags-append \
-D_DARWIN_C_SOURCE
ffmpeg.version 4
depends_build port:pkgconfig
depends_build path:bin/pkg-config:pkgconfig
depends_lib port:libiconv \
port:ncurses \
path:lib/libavcodec.dylib:ffmpeg \
port:libmad \
port:mpc \
port:libmagic \
port:libmodplug \
port:libmpcdec \
port:libogg \
port:libsndfile \
port:libid3tag \
port:libsamplerate \
port:libtool \
port:libvorbis \
path:lib/libspeex.dylib:speex \
port:taglib \
port:flac \
port:jack \
port:faad2 \
port:curl
port:curl \
port:popt \
port:wavpack \
port:zlib
patchfiles patch-ffmpeg-3.0.diff \
patch-ffmpeg-4.0.diff
patchfiles patch-ffmpeg-4.0.diff \
patch-tags-cache.diff
post-patch {
reinplace {s|AC_CHECK_LIB(\[rt], \[clock_gettime]|AC_SEARCH_LIBS([clock_gettime], [rt]|} \
${worksrcpath}/configure.in
}
use_autoreconf yes
autoreconf.args -fvi
configure.args --with-jack --without-vorbis --disable-cache
configure.args --with-jack --disable-cache
# For configure
configure.cflags-append \
-Wno-error=unused-but-set-parameter
#default_variants +autojack
@@ -59,9 +76,4 @@ configure.args --with-jack --without-vorbis --disable-cache
# patchfiles-append patch-autojack.diff
#}
variant vorbis description {Add support for ogg files} {
depends_lib-append port:libvorbis
configure.args-delete --without-vorbis
}
livecheck.regex ">${name}-\(\.*\)\.tar"
-125
View File
@@ -1,125 +0,0 @@
Index: configure.in
===================================================================
--- configure.in (revision 2781)
+++ configure.in (revision 2785)
@@ -483,19 +483,3 @@
echo " you will not hear any sound!"
echo
fi
-
-dnl
-dnl If the warning below gets reported, then for further guidance:
-dnl
-dnl vi +/REQUEST_CHANNELS decoder_plugins/ffmpeg/ffmpeg.c
-dnl
-if test "x$want_ffmpeg" = "xyes" && \
- test "x$ac_cv_member_struct_AVCodecContext_request_channels" != "xyes"
-then
- echo "WARNING: It appears that the FFmpeg/LibAV API has changed and no longer"
- echo " supports downmixing to stereo as it did previously. Report"
- echo " this message along with the output of 'ffmpeg -version' to"
- echo " <$PACKAGE_BUGREPORT>. Meanwhile, you may have to live without"
- echo " stereo downmixing."
- echo
-fi
Index: decoder_plugins/ffmpeg/ffmpeg.m4
===================================================================
--- decoder_plugins/ffmpeg/ffmpeg.m4 (revision 2781)
+++ decoder_plugins/ffmpeg/ffmpeg.m4 (revision 2785)
@@ -39,6 +39,8 @@
LIBS="$LIBS $ffmpeg_LIBS"
AC_CHECK_MEMBERS([struct AVCodecContext.request_channels], [], [],
[#include <libavcodec/avcodec.h>])
+ AC_CHECK_HEADERS([ffmpeg/avformat.h \
+ libavformat/avformat.h libavutil/channel_layout.h])
AC_SEARCH_LIBS(avcodec_open2, avcodec,
[AC_DEFINE([HAVE_AVCODEC_OPEN2], 1,
[Define to 1 if you have the `avcodec_open2' function.])])
@@ -46,6 +48,9 @@
[AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO4], 1,
[Define to 1 if you have the `avcodec_decode_audio4' function.])],
[AX_FUNC_POSIX_MEMALIGN])
+ AC_SEARCH_LIBS(av_packet_unref, avcodec,
+ [AC_DEFINE([HAVE_AV_PACKET_UNREF], 1,
+ [Define to 1 if you have the `av_packet_unref' function.])])
AC_SEARCH_LIBS(avformat_close_input, avformat,
[AC_DEFINE([HAVE_AVFORMAT_CLOSE_INPUT], 1,
[Define to 1 if you have the `avformat_close_input' function.])])
Index: decoder_plugins/ffmpeg/ffmpeg.c
===================================================================
--- decoder_plugins/ffmpeg/ffmpeg.c (revision 2781)
+++ decoder_plugins/ffmpeg/ffmpeg.c (revision 2785)
@@ -66,7 +66,11 @@
GCC_DIAG_ON(deprecated-declarations)
#include <libavutil/mathematics.h>
#ifdef HAVE_AV_GET_CHANNEL_LAYOUT_NB_CHANNELS
-#include <libavutil/audioconvert.h>
+# if HAVE_LIBAVUTIL_CHANNEL_LAYOUT_H
+# include <libavutil/channel_layout.h>
+# else
+# include <libavutil/audioconvert.h>
+# endif
#endif
/* FFmpeg also likes common names, without that, our common.h and log.h
@@ -781,32 +785,11 @@
return;
#endif
- data->enc->channels = 2;
-
#ifdef HAVE_STRUCT_AVCODECCONTEXT_REQUEST_CHANNELS
-
- /*
- * When FFmpeg breaks its API (and it will), this code will be
- * disabled and users will complain that MOC no longer downmixes
- * to stereo. This is because the 'request_channels' field in
- * AVCodecContext is marked as deprecated (and so will probably
- * be removed at some time) but FFmpeg requires it to be set to
- * trigger downmixing (go figure!). Currently, there is no
- * guidance on how it will work in the future, but looking at
- * where 's->downmixed' is set near the end of 'ac3_decode_init()'
- * in the FFmpeg's source code file 'libavcodec/ac3dec.c' might
- * help (in the absence of proper documentation).
- */
-
set_request_channels (data->enc, 2);
-
-#ifdef AV_CH_LAYOUT_STEREO_DOWNMIX
- data->enc->request_channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
#else
- data->enc->request_channel_layout = CH_LAYOUT_STEREO_DOWNMIX;
+ data->enc->request_channel_layout = AV_CH_LAYOUT_STEREO;
#endif
-
-#endif
}
static void *ffmpeg_open (const char *file)
@@ -1076,7 +1059,12 @@
{
assert (pkt);
+#if HAVE_AV_PACKET_UNREF
+ av_packet_unref (pkt);
+#else
av_free_packet (pkt);
+#endif
+
free (pkt);
}
Index: decoder_plugins/ffmpeg/ffmpeg.m4
===================================================================
--- decoder_plugins/ffmpeg/ffmpeg.m4 (revision 2799)
+++ decoder_plugins/ffmpeg/ffmpeg.m4 (revision 2800)
@@ -39,8 +39,7 @@
LIBS="$LIBS $ffmpeg_LIBS"
AC_CHECK_MEMBERS([struct AVCodecContext.request_channels], [], [],
[#include <libavcodec/avcodec.h>])
- AC_CHECK_HEADERS([ffmpeg/avformat.h \
- libavformat/avformat.h libavutil/channel_layout.h])
+ AC_CHECK_HEADERS([libavutil/channel_layout.h])
AC_SEARCH_LIBS(avcodec_open2, avcodec,
[AC_DEFINE([HAVE_AVCODEC_OPEN2], 1,
[Define to 1 if you have the `avcodec_open2' function.])])
@@ -0,0 +1,28 @@
--- tags_cache.c.orig 2016-11-16 04:29:53
+++ tags_cache.c 2026-05-15 13:56:03
@@ -37,7 +37,9 @@
#define DEBUG
+#ifdef HAVE_DB_H
#define STRERROR_FN bdb_strerror
+#endif
#include "common.h"
#include "server.h"
@@ -119,6 +121,7 @@
};
/* BerkleyDB-provided error code to description function wrapper. */
+#ifdef HAVE_DB_H
static inline char *bdb_strerror (int errnum)
{
char *result;
@@ -130,6 +133,7 @@
return result;
}
+#endif
static void request_queue_init (struct request_queue *q)
{