On 07/18 05:58, Alexandre Ratchov wrote:
> On Sat, Jul 18, 2015 at 08:52:12AM -0700, Jeremy Evans wrote:
> > On 07/18 04:22, Stuart Henderson wrote:
> > > On 2015/07/18 00:18, Jeremy Evans wrote:
> > > > This updates aqualung to the latest release, which is still about a
> > > > year old. I'm encouraging my fellow upstream developers to release
> > > > a final 1.0, but in the meantime this is a lot more current than the
> > > > 0.9beta11 we have in the tree, which was released over 5 years ago.
> > >
> > > First time I tried with this update, it was hanging for me..
> > > It started (with a few errors; it took about 5 seconds for the
> > > attempts at using jack) :
> >
> > Does anyone care about jack support? I'm fine with removing it
> > (--without-jack) and making sndio the only output option. That should
> > hopefully fix this issue on initial startup.
>
> Jack is not designed to serve a general purpose audio server, it's
> more about synchronizing & passing data between programs, ex to
> build a DAW.
>
> IIRC, the jack backend used to make sense when we did't have sndio
> backend yet, so now it's not very useful.
Here's a new diff that removes the jack stuff. This pulls in
libsamplerate as that was previously pulled in via jack. This
also removes some now-unsupported configure flags, as well fixing
the vorbis configure flag and explicitly disabling winmm.
OKs?
Thanks,
Jeremy
Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/aqualung/Makefile,v
retrieving revision 1.39
diff -u -p -u -p -r1.39 Makefile
--- Makefile 8 May 2015 09:08:44 -0000 1.39
+++ Makefile 18 Jul 2015 16:37:24 -0000
@@ -2,8 +2,8 @@
COMMENT= advanced music player
-DISTNAME= aqualung-0.9beta11
-REVISION= 13
+DISTNAME= aqualung-1.0-rc1
+PKGNAME= aqualung-1.0rc1
EPOCH= 0
CATEGORIES= audio
@@ -21,7 +21,7 @@ WANTLIB += gthread-2.0 m mp3lame ogg pan
WANTLIB += pangoft2-1.0 pthread samplerate sndfile sndio stdc++
WANTLIB += vorbis vorbisenc vorbisfile z gtk-x11-2.0 gdk-x11-2.0
WANTLIB += gdk_pixbuf-2.0 xml2 mac mad mpcdec FLAC avcodec
-WANTLIB += avformat avutil jack wavpack lrdf oggz speex cddb cdio
+WANTLIB += avformat avutil wavpack lrdf oggz speex cddb cdio
WANTLIB += cdio_cdda cdio_paranoia modplug ${MODLUA_WANTLIB}
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=aqualung/}
@@ -31,16 +31,13 @@ MODULES= devel/gettext \
MODLUA_SA= Yes
-BUILD_DEPENDS= devel/autoconf/2.63 \
- devel/automake/1.10
-
LIB_DEPENDS= audio/flac \
- audio/jack \
audio/lame \
audio/libcdio \
audio/libcddb \
audio/libmad \
audio/libmodplug \
+ audio/libsamplerate \
audio/libsndfile \
audio/libvorbis \
audio/mac \
@@ -56,49 +53,41 @@ LIB_DEPENDS= audio/flac \
RUN_DEPENDS= devel/desktop-file-utils
-AUTOCONF_VERSION= 2.63
-AUTOMAKE_VERSION= 1.10
-
CFLAGS+= -DPTHREAD_MIN_PRIORITY=0 -DPTHREAD_MAX_PRIORITY=31 \
-I${LOCALBASE}/include -I${MODLUA_INCL_DIR}
CONFIGURE_STYLE= gnu
-CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib "
+CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib " \
+ lua_CFLAGS="`pkg-config --cflags ${MODLUA_DEP}`" \
+ lua_LIBS="`pkg-config --libs ${MODLUA_DEP}`"
# ifp (requires libifp) - no package
CONFIGURE_ARGS= --with-cdda \
--with-cddb \
--with-flac \
- --with-jack \
--with-ladspa \
--with-lame \
--with-lavc \
- --with-loop \
--with-lua \
--with-mac \
--with-mod \
--with-mpc \
--with-mpeg \
- --with-ogg \
- --with-podcast \
--with-sndfile \
--with-sndio \
--with-speex \
--with-src \
- --with-systray \
+ --with-vorbis \
--with-vorbisenc \
--with-wavpack \
--without-alsa \
--without-ifp \
+ --without-jack \
--without-oss \
- --without-pulse
-
-post-patch:
- @cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
- AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./autogen.sh
+ --without-pulse \
+ --without-winmm
post-install:
- mv ${PREFIX}/share/aqualung/doc ${PREFIX}/share/doc/aqualung
${INSTALL_DATA_DIR} ${PREFIX}/share/applications
@${SUBST_CMD} -m 0644 -c ${FILESDIR}/aqualung.desktop \
${PREFIX}/share/applications/aqualung.desktop
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/aqualung/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- distinfo 18 Jan 2015 03:12:39 -0000 1.4
+++ distinfo 18 Jul 2015 05:43:39 -0000
@@ -1,2 +1,2 @@
-SHA256 (aqualung-0.9beta11.tar.gz) =
MV6uRTnBA5l404vXvI75ZfPp3FGMfrb06dpSqb8zLd0=
-SIZE (aqualung-0.9beta11.tar.gz) = 1584700
+SHA256 (aqualung-1.0-rc1.tar.gz) = S2x+ijivnwP7BC+BM8zoNPh9f1SJyvKoXp0tHkKK4ks=
+SIZE (aqualung-1.0-rc1.tar.gz) = 1939271
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- patches/patch-configure_ac 18 Jan 2013 08:15:55 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,116 +0,0 @@
-$OpenBSD: patch-configure_ac,v 1.1 2013/01/18 08:15:55 brad Exp $
---- configure.ac.orig Sun Jan 31 11:29:58 2010
-+++ configure.ac Thu Jan 17 23:31:40 2013
-@@ -335,6 +335,21 @@ else
- fi
- fi
-
-+AC_ARG_WITH([lavc],
-+ [AS_HELP_STRING([--with-lavc],
-+ [compile with Libav / FFmpeg support (default: detect)])],
-+ [], [with_lavc='detect'])
-+AS_IF([test "x$with_lavc" != 'xno'], [
-+ AC_MSG_NOTICE([Libav / FFmpeg Support])
-+ PKG_CHECK_MODULES([lavc], [libavcodec libavformat libavutil],
-+ [AS_IF([test "x$with_lavc" = 'xdetect'], [with_lavc='yes (found)'])],
-+ [AS_IF([test "x$with_lavc" = 'xyes'],
-+ [AC_MSG_ERROR([$lavc_PKG_ERRORS])])])
-+ AS_CASE([$with_lavc],
-+ [detect], [with_lavc='not found'],
-+ [yes*], [AC_DEFINE([HAVE_LAVC], [1],
-+ [Define to build with Libav / FFmpeg support])])
-+])
-
- AC_MSG_CHECKING(for sndfile support)
- AC_ARG_WITH(
-@@ -601,81 +616,6 @@ else
- fi
-
-
--AC_MSG_CHECKING(for LAVC support)
--AC_ARG_WITH(
-- lavc,
-- [ --with-lavc=yes,no compile with lavc (FFmpeg) support (default:
yes)],
-- lavc="$withval",
-- lavc="detect")
--if test "$lavc" = "no"; then
-- AC_MSG_RESULT(no)
--else
-- AC_CHECK_HEADER([avcodec.h], [avc_hdr=yes], [avc_hdr=no])
-- if test "$avc_hdr" = "yes"; then
-- AC_DEFINE([HAVE_AVCODEC_H], [1], [Define to 1 if you have the
<avcodec.h> header file.])
-- else
-- AC_CHECK_HEADER([ffmpeg/avcodec.h], [avc_hdr=yes], [avc_hdr=no])
-- if test "$avc_hdr" = "yes"; then
-- AC_DEFINE([HAVE_FFMPEG_AVCODEC_H], [1], [Define to 1 if
you have the <ffmpeg/avcodec.h> header file.])
-- else
-- AC_CHECK_HEADER([libavcodec/avcodec.h], [avc_hdr=yes],
[avc_hdr=no])
-- if test "$avc_hdr" = "yes"; then
-- AC_DEFINE([HAVE_LIBAVCODEC_AVCODEC_H], [1],
[Define to 1 if you have the <libavcodec/avcodec.h> header file.])
-- else
-- AC_CHECK_HEADER([ffmpeg/libavcodec/avcodec.h],
[avc_hdr=yes], [avc_hdr=no])
-- if test "$avc_hdr" = "yes"; then
--
AC_DEFINE([HAVE_FFMPEG_LIBAVCODEC_AVCODEC_H], [1], [Define to 1 if you have the
<ffmpeg/libavcodec/avcodec.h> header file.])
-- else
-- PKG_CHECK_MODULES(LIBAVCODEC,
libavcodec, [avc_hdr=yes], [avc_hdr=no])
-- if test "$avc_hdr" = "yes"; then
-- AC_DEFINE([HAVE_LIBAVCODEC_AVCODEC_H], [1],
[Define to 1 if you have the <libavcodec/avcodec.h> header file.])
-- fi
-- fi
-- fi
-- fi
-- fi
--
-- AC_CHECK_HEADER([avformat.h], [avf_hdr=yes], [avf_hdr=no])
-- if test "$avf_hdr" = "yes"; then
-- AC_DEFINE([HAVE_AVFORMAT_H], [1], [Define to 1 if you have the
<avformat.h> header file.])
-- else
-- AC_CHECK_HEADER([ffmpeg/avformat.h], [avf_hdr=yes],
[avf_hdr=no])
-- if test "$avf_hdr" = "yes"; then
-- AC_DEFINE([HAVE_FFMPEG_AVFORMAT_H], [1], [Define to 1
if you have the <ffmpeg/avformat.h> header file.])
-- else
-- AC_CHECK_HEADER([libavformat/avformat.h],
[avf_hdr=yes], [avf_hdr=no])
-- if test "$avf_hdr" = "yes"; then
-- AC_DEFINE([HAVE_LIBAVFORMAT_AVFORMAT_H], [1],
[Define to 1 if you have the <libavformat/avformat.h> header file.])
-- else
--
AC_CHECK_HEADER([ffmpeg/libavformat/avformat.h], [avf_hdr=yes], [avf_hdr=no])
-- if test "$avf_hdr" = "yes"; then
--
AC_DEFINE([HAVE_FFMPEG_LIBAVFORMAT_AVFORMAT_H], [1], [Define to 1 if you have
the <ffmpeg/libavformat/avformat.h> header file.])
-- else
-- PKG_CHECK_MODULES(LIBAVFORMAT,
libavformat, [avf_hdr=yes], [avf_hdr=no])
-- if test "$avf_hdr" = "yes"; then
-- AC_DEFINE([HAVE_LIBAVFORMAT_AVFORMAT_H], [1],
[Define to 1 if you have the <libavformat/avformat.h> header file.])
-- fi
-- fi
-- fi
-- fi
-- fi
--
-- AC_CHECK_LIB(avformat, av_open_input_file, [avf_lib=yes], [avf_lib=no],
[-lavcodec -lavutil -lz])
-- AC_CHECK_LIB(avcodec, avcodec_open, [avc_lib=yes], [avc_lib=no],
[-lavformat -lavutil -lz])
--
-- if test "$avc_hdr" = "yes" -a "$avf_hdr" = "yes" -a "$avc_lib" = "yes"
-a "$avf_lib" = "yes" ; then
-- lavc_LIBS="-lavformat -lavcodec -lavutil -lz"
-- AC_DEFINE([HAVE_LAVC], [1], [Defined if compile with LAVC
support])
-- lavc="yes"
-- else
-- if test "$lavc" = "yes"; then
-- AC_MSG_ERROR(You do not appear to have the LAVC decoder
library (FFmpeg) installed. Grab it from http://ffmpeg.mplayerhq.hu/)
-- fi
-- lavc="no"
-- fi
--fi
--
--
- AC_MSG_CHECKING(for LAME (MP3 encoding) support)
- AC_ARG_WITH(
- lame,
-@@ -1005,7 +945,7 @@ echo " MOD Audio (MOD, S3M, XM, IT, etc.) : $mo
- echo " Musepack : $mpc"
- echo " Monkey's Audio Codec : $mac"
- echo " WavPack : $wavpack"
--echo " LAVC (AC3, AAC, WavPack, WMA, etc.) : $lavc"
-+echo " LAVC (AC3, AAC, WavPack, WMA, etc.) : $with_lavc"
- echo
- echo " Encoding support:"
- echo " sndfile (WAV) : $sndfile"
Index: patches/patch-src_core_c
===================================================================
RCS file: patches/patch-src_core_c
diff -N patches/patch-src_core_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_core_c 18 Jul 2015 05:58:33 -0000
@@ -0,0 +1,54 @@
+$OpenBSD$
+
+Fix use-after-free when sample rate switches. This isn't a perfect fix,
+as it does result in some uninitialized memory be used (displayed for
+a split second if the sample rate switches), but it's better than
+crashing.
+
+--- src/core.c.orig Tue Jun 3 08:08:19 2014
++++ src/core.c Fri Jul 17 23:54:46 2015
+@@ -372,7 +372,8 @@ disk_thread(void * arg) {
+ (fdec->pdec != NULL)) {
+
+ decoder_t * dec = (decoder_t
*)fdec->pdec;
+-
++ fileinfo_t fileinfo_sent;
++
+ cdda_decoder_reopen(dec,
filename);
+ fdec->samples_left =
fdec->fileinfo.total_samples;
+
+@@ -382,9 +383,11 @@ disk_thread(void * arg) {
+ sample_offset = 0;
+
+ send_cmd = CMD_FILEINFO;
++ fileinfo_sent = fdec->fileinfo;
++ fileinfo_sent.format_str =
strdup(fdec->fileinfo.format_str);
+ rb_write(rb_disk2gui, &send_cmd,
+
sizeof(send_cmd));
+- rb_write(rb_disk2gui, (char
*)&(fdec->fileinfo),
++ rb_write(rb_disk2gui, (char
*)&fileinfo_sent,
+
sizeof(fileinfo_t));
+
+ info->is_streaming = 1;
+@@ -411,6 +414,8 @@ disk_thread(void * arg) {
+ rb_write(rb_disk2gui,
&send_cmd, 1);
+ goto sleep;
+ } else {
++ fileinfo_t fileinfo_sent;
++
+ file_decoder_set_rva(fdec,
cue.voladj);
+ info->in_SR_prev = info->in_SR;
+ info->in_SR =
fdec->fileinfo.sample_rate;
+@@ -430,9 +435,11 @@ disk_thread(void * arg) {
+ sample_offset = 0;
+
+ send_cmd = CMD_FILEINFO;
++ fileinfo_sent = fdec->fileinfo;
++ fileinfo_sent.format_str =
strdup(fdec->fileinfo.format_str);
+ rb_write(rb_disk2gui, &send_cmd,
+
sizeof(send_cmd));
+- rb_write(rb_disk2gui, (char
*)&(fdec->fileinfo),
++ rb_write(rb_disk2gui, (char
*)&fileinfo_sent,
+
sizeof(fileinfo_t));
+
+ info->is_streaming = 1;
Index: patches/patch-src_decoder_Makefile_am
===================================================================
RCS file: patches/patch-src_decoder_Makefile_am
diff -N patches/patch-src_decoder_Makefile_am
--- patches/patch-src_decoder_Makefile_am 18 Jan 2013 08:15:55 -0000
1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-src_decoder_Makefile_am,v 1.1 2013/01/18 08:15:55 brad Exp $
---- src/decoder/Makefile.am.orig Thu Jan 17 23:24:01 2013
-+++ src/decoder/Makefile.am Thu Jan 17 23:24:40 2013
-@@ -1,6 +1,6 @@
- noinst_LIBRARIES = libdecoder.a
-
--libdecoder_a_CFLAGS = $(LIBAVCODEC_CFLAGS) $(LIBAVFORMAT_CFLAGS)
-+libdecoder_a_CFLAGS = $(lavc_CFLAGS)
-
- libdecoder_a_SOURCES = \
- dec_cdda.h dec_cdda.c \
Index: patches/patch-src_decoder_dec_lavc_c
===================================================================
RCS file: patches/patch-src_decoder_dec_lavc_c
diff -N patches/patch-src_decoder_dec_lavc_c
--- patches/patch-src_decoder_dec_lavc_c 27 Mar 2014 21:38:10 -0000
1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,154 +0,0 @@
-$OpenBSD: patch-src_decoder_dec_lavc_c,v 1.4 2014/03/27 21:38:10 brad Exp $
-
-Update for newer FFmpeg API.
-
---- src/decoder/dec_lavc.c.orig Thu Aug 20 14:11:11 2009
-+++ src/decoder/dec_lavc.c Thu Mar 27 01:12:13 2014
-@@ -25,6 +25,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
-+#include <libavutil/avutil.h>
-
- #include "dec_lavc.h"
-
-@@ -36,6 +37,45 @@
-
- extern size_t sample_size;
-
-+/* Adapted from avcodec_decode_audio3() implementation found at:
-+ * https://raw.github.com/FFmpeg/FFmpeg/master/libavcodec/utils.c
-+ */
-+int decode_audio3(AVCodecContext *avctx, int16_t *samples, int
*frame_size_ptr, AVPacket *avpkt) {
-+ int ret;
-+#if LIBAVCODEC_VERSION_MAJOR < 53
-+ ret = avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt);
-+#else /* LIBAVCODEC_VERSION_MAJOR >= 53 */
-+ AVFrame frame = { { 0 } };
-+ int got_frame = 0;
-+
-+ ret = avcodec_decode_audio4(avctx, &frame, &got_frame, avpkt);
-+ if (ret >= 0 && got_frame) {
-+ int ch, plane_size;
-+ int planar = av_sample_fmt_is_planar(avctx->sample_fmt);
-+ int data_size = av_samples_get_buffer_size(&plane_size,
avctx->channels,
-+ frame.nb_samples,
avctx->sample_fmt, 1);
-+ if (*frame_size_ptr < data_size) {
-+ av_log(avctx, AV_LOG_ERROR, "output buffer size is too
small for "
-+ "the current frame (%d < %d)\n",
*frame_size_ptr, data_size);
-+ return AVERROR(EINVAL);
-+ }
-+ memcpy(samples, frame.extended_data[0], plane_size);
-+
-+ if (planar && avctx->channels > 1) {
-+ uint8_t *out = ((uint8_t *)samples) + plane_size;
-+ for (ch = 1; ch < avctx->channels; ch++) {
-+ memcpy(out, frame.extended_data[ch],
plane_size);
-+ out += plane_size;
-+ }
-+ }
-+ *frame_size_ptr = data_size;
-+ } else {
-+ *frame_size_ptr = 0;
-+ }
-+#endif /* LIBAVCODEC_VERSION_MAJOR >= 53 */
-+ return ret;
-+}
-+
- /* return 1 if reached end of stream, 0 else */
- int
- decode_lavc(decoder_t * dec) {
-@@ -44,16 +84,16 @@ decode_lavc(decoder_t * dec) {
- file_decoder_t * fdec = dec->fdec;
-
- AVPacket packet;
-- int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE];
-- float fsamples[AVCODEC_MAX_AUDIO_FRAME_SIZE];
-- int n_bytes = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-+ int16_t samples[MAX_AUDIO_FRAME_SIZE];
-+ float fsamples[MAX_AUDIO_FRAME_SIZE];
-+ int n_bytes = MAX_AUDIO_FRAME_SIZE;
-
- if (av_read_frame(pd->avFormatCtx, &packet) < 0)
- return 1;
-
- if (packet.stream_index == pd->audioStream) {
-
-- avcodec_decode_audio2(pd->avCodecCtx, samples, &n_bytes,
packet.data, packet.size);
-+ decode_audio3(pd->avCodecCtx, samples, &n_bytes, &packet);
- if (n_bytes > 0) {
- int i;
- for (i = 0; i < n_bytes/2; i++) {
-@@ -111,11 +151,23 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
- file_decoder_t * fdec = dec->fdec;
- int i;
-
-+#if LIBAVFORMAT_VERSION_MAJOR < 53
- if (av_open_input_file(&pd->avFormatCtx, filename, NULL, 0, NULL) != 0)
-+#else /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+ if (avformat_open_input(&pd->avFormatCtx, filename, NULL, NULL) != 0)
-+#endif /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+ {
- return DECODER_OPEN_BADLIB;
-+ }
-
-+#if LIBAVFORMAT_VERSION_MAJOR < 53
- if (av_find_stream_info(pd->avFormatCtx) < 0)
-+#else /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+ if (avformat_find_stream_info(pd->avFormatCtx, NULL) < 0)
-+#endif /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+ {
- return DECODER_OPEN_BADLIB;
-+ }
-
- /* debug */
- #ifdef LAVC_DEBUG
-@@ -124,7 +176,7 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
-
- pd->audioStream = -1;
- for (i = 0; i < pd->avFormatCtx->nb_streams; i++) {
-- if (pd->avFormatCtx->streams[i]->codec->codec_type ==
CODEC_TYPE_AUDIO) {
-+ if (pd->avFormatCtx->streams[i]->codec->codec_type ==
AVMEDIA_TYPE_AUDIO) {
- pd->audioStream = i;
- break;
- }
-@@ -133,6 +185,10 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
- return DECODER_OPEN_BADLIB;
-
- pd->avCodecCtx = pd->avFormatCtx->streams[pd->audioStream]->codec;
-+#if LIBAVCODEC_VERSION_MAJOR >= 53
-+ pd->avCodecCtx->get_buffer = avcodec_default_get_buffer;
-+ pd->avCodecCtx->release_buffer = avcodec_default_release_buffer;
-+#endif /* LIBAVCODEC_VERSION_MAJOR >= 53 */
-
- pd->time_base = pd->avFormatCtx->streams[pd->audioStream]->time_base;
-
-@@ -140,8 +196,14 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
- if (pd->avCodec == NULL)
- return DECODER_OPEN_BADLIB;
-
-+#if LIBAVCODEC_VERSION_MAJOR < 53
- if (avcodec_open(pd->avCodecCtx, pd->avCodec) < 0)
-+#else /* LIBAVCODEC_VERSION_MAJOR >= 53 */
-+ if (avcodec_open2(pd->avCodecCtx, pd->avCodec, NULL) < 0)
-+#endif /* LIBAVCODEC_VERSION_MAJOR >= 53 */
-+ {
- return DECODER_OPEN_BADLIB;
-+ }
-
- if ((pd->avCodecCtx->channels != 1) && (pd->avCodecCtx->channels != 2))
{
- fprintf(stderr,
-@@ -184,7 +246,13 @@ lavc_decoder_close(decoder_t * dec) {
- lavc_pdata_t * pd = (lavc_pdata_t *)dec->pdata;
-
- avcodec_close(pd->avCodecCtx);
-+
-+#if LIBAVFORMAT_VERSION_MAJOR < 53
- av_close_input_file(pd->avFormatCtx);
-+#else /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+ avformat_close_input(&pd->avFormatCtx);
-+#endif /* LIBAVFORMAT_VERSION_MAJOR >= 53 */
-+
- rb_free(pd->rb);
- }
-
Index: patches/patch-src_decoder_dec_lavc_h
===================================================================
RCS file: patches/patch-src_decoder_dec_lavc_h
diff -N patches/patch-src_decoder_dec_lavc_h
--- patches/patch-src_decoder_dec_lavc_h 27 Mar 2014 21:38:10 -0000
1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-src_decoder_dec_lavc_h,v 1.5 2014/03/27 21:38:10 brad Exp $
-
-Update for newer FFmpeg API.
-
---- src/decoder/dec_lavc.h.orig Thu Aug 20 14:11:11 2009
-+++ src/decoder/dec_lavc.h Thu Mar 27 00:48:37 2014
-@@ -24,25 +24,9 @@
-
- #ifdef HAVE_LAVC
-
--#ifdef HAVE_FFMPEG_LIBAVCODEC_AVCODEC_H
--#include <ffmpeg/libavcodec/avcodec.h>
--#elif defined HAVE_LIBAVCODEC_AVCODEC_H
- #include <libavcodec/avcodec.h>
--#elif defined HAVE_FFMPEG_AVCODEC_H
--#include <ffmpeg/avcodec.h>
--#elif defined HAVE_AVCODEC_H
--#include <avcodec.h>
--#endif
--
--#ifdef HAVE_FFMPEG_LIBAVFORMAT_AVFORMAT_H
--#include <ffmpeg/libavformat/avformat.h>
--#elif defined HAVE_LIBAVFORMAT_AVFORMAT_H
- #include <libavformat/avformat.h>
--#elif defined HAVE_FFMPEG_AVFORMAT_H
--#include <ffmpeg/avformat.h>
--#elif defined AVFORMAT_H
--#include <avformat.h>
--#endif
-+#include <libavutil/rational.h>
-
- #endif /* HAVE_LAVC */
-
-@@ -50,7 +34,8 @@
-
- #ifdef HAVE_LAVC
-
--#define RB_LAVC_SIZE (3*AVCODEC_MAX_AUDIO_FRAME_SIZE)
-+#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-+#define RB_LAVC_SIZE (3*MAX_AUDIO_FRAME_SIZE)
-
- typedef struct _lavc_pdata_t {
- rb_t * rb;
Index: patches/patch-src_ext_lua_c
===================================================================
RCS file: patches/patch-src_ext_lua_c
diff -N patches/patch-src_ext_lua_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_ext_lua_c 18 Jul 2015 06:53:03 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Work with Lua 5.2 (r1302).
+
+--- src/ext_lua.c.orig Sat Jul 18 00:52:28 2015
++++ src/ext_lua.c Sat Jul 18 00:52:46 2015
+@@ -550,7 +550,7 @@ void setup_extended_title_formatting(void) {
+ L = NULL;
+ }
+
+- L = lua_open();
++ L = luaL_newstate();
+ luaL_openlibs(L);
+
+ error = luaL_dostring(L, AQUALUNG_LUA_API);
Index: patches/patch-src_ext_title_format_c
===================================================================
RCS file: patches/patch-src_ext_title_format_c
diff -N patches/patch-src_ext_title_format_c
--- patches/patch-src_ext_title_format_c 10 Jul 2012 15:22:44 -0000
1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-src_ext_title_format_c,v 1.1 2012/07/10 15:22:44 jasper Exp $
---- src/ext_title_format.c.orig Mon Jul 9 19:26:50 2012
-+++ src/ext_title_format.c Mon Jul 9 19:27:51 2012
-@@ -25,15 +25,9 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#ifdef LUA_HEADER_lua5_1
--#include <lua5.1/lua.h>
--#include <lua5.1/lauxlib.h>
--#include <lua5.1/lualib.h>
--#else
- #include <lua.h>
- #include <lauxlib.h>
- #include <lualib.h>
--#endif /* LUA_HEADER_DIR */
- #include "metadata.h"
- #include "decoder/file_decoder.h"
- #include "options.h"
Index: patches/patch-src_gui_main_c
===================================================================
RCS file: patches/patch-src_gui_main_c
diff -N patches/patch-src_gui_main_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_gui_main_c 18 Jul 2015 05:58:52 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Part of the use-after-free fix.
+
+--- src/gui_main.c.orig Tue Jun 3 08:08:19 2014
++++ src/gui_main.c Fri Jul 17 23:54:46 2015
+@@ -3974,6 +3974,10 @@ timeout_callback(gpointer data) {
+ case CMD_FILEINFO:
+ while (rb_read_space(rb_disk2gui) < sizeof(fileinfo_t))
+ ;
++ if (fileinfo.format_str != NULL) { /* free previous
format_str, if there is one */
++ free(fileinfo.format_str);
++ fileinfo.format_str = NULL;
++ }
+ rb_read(rb_disk2gui, (char *)&fileinfo,
sizeof(fileinfo_t));
+
+ sample_pos = 0;
Index: patches/patch-src_plugin_c
===================================================================
RCS file: patches/patch-src_plugin_c
diff -N patches/patch-src_plugin_c
--- patches/patch-src_plugin_c 24 Oct 2010 19:10:15 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-src_plugin_c,v 1.1 2010/10/24 19:10:15 jakemsr Exp $
---- src/plugin.c.orig Sun Oct 24 10:10:50 2010
-+++ src/plugin.c Sun Oct 24 10:12:18 2010
-@@ -43,7 +43,7 @@
- #include "plugin.h"
-
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__OpenBSD__)
- #define dirent64 dirent
- #define scandir64 scandir
- #define alphasort64 alphasort
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/aqualung/pkg/PLIST,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 PLIST
--- pkg/PLIST 9 Jun 2010 08:32:35 -0000 1.7
+++ pkg/PLIST 18 Jul 2015 06:19:07 -0000
@@ -1,7 +1,6 @@
@comment $OpenBSD: PLIST,v 1.7 2010/06/09 08:32:35 sthen Exp $
@bin bin/aqualung
@man man/man1/aqualung.1
-@owner root
share/applications/aqualung.desktop
share/aqualung/
share/aqualung/appearance.png
@@ -164,12 +163,18 @@ share/doc/aqualung/systray.png
share/doc/aqualung/timer.eps
share/doc/aqualung/timer.png
share/locale/de/LC_MESSAGES/aqualung.mo
+share/locale/es/LC_MESSAGES/aqualung.mo
share/locale/fr/LC_MESSAGES/aqualung.mo
share/locale/hu/LC_MESSAGES/aqualung.mo
share/locale/it/LC_MESSAGES/aqualung.mo
share/locale/ja/LC_MESSAGES/aqualung.mo
+share/locale/nl/LC_MESSAGES/aqualung.mo
+share/locale/pl/LC_MESSAGES/aqualung.mo
share/locale/ru/LC_MESSAGES/aqualung.mo
share/locale/sv/LC_MESSAGES/aqualung.mo
share/locale/uk/LC_MESSAGES/aqualung.mo
+share/locale/zh/
+share/locale/zh/LC_MESSAGES/
+share/locale/zh/LC_MESSAGES/aqualung.mo
@exec %D/bin/update-desktop-database
@unexec-delete %D/bin/update-desktop-database