summaryrefslogtreecommitdiff
path: root/audio/moc
diff options
context:
space:
mode:
authorleot <leot>2016-02-16 08:46:01 +0000
committerleot <leot>2016-02-16 08:46:01 +0000
commitc675c089e601a94aebb1bc3bb11c34be134a848a (patch)
tree2c628fd3fa1f18723c71406657752e876b996b4f /audio/moc
parentdbeb1c222f3e134f8be81a4eb461d8c9b71e9ca5 (diff)
downloadpkgsrc-c675c089e601a94aebb1bc3bb11c34be134a848a.tar.gz
Update audio/moc to 2.5.0.
Patch provided by Onno van der Linden via pkg/50803. Changes: 2.5.0 - "Consolidation" * Autotools and packaging changes: - Upgraded autoconf version requirement to 2.60 - Added '--with-alsa' to suppress ALSA sound driver inclusion - Added '--without-oss' to suppress OSS sound driver inclusion - Added '--disable-cache' to remove tags cache support - Added specific GDB support to '--enable-debug' - Refactor decoder plug-ins' autoconf scripts into source directories - Ensure that all decoders get into the source distribution tarball - Removed SID decoder's dependance on .la-file presence - Removed distribution-specific .spec file - Minor reformatting of the configure summary - Added warnings for various deprecations and potential problems - Added warnings for unmet future package requirements - Updated GNU boilerplate text * Improved support for embedded systems: - Refined FFmpeg decoder configuration for use with cross-compilation - Provided use of Tremor with the Vorbis decoder - Improve portability to non-GNU library platforms - Added --with-libiconv-prefix configure option * Audio driver changes: - Allow use of the OSSv4 per-application mixer API - Provided SNDIO support for OpenBSD systems (Alexander Polakov) * New and changed audio decoders: - New TiMidity decoder for MIDI (Hendrik Iben) - Migrate AAC decoder to later FAAD2 API (Max Klinger) - Added AAC+ (HE-AAC) support to AAC decoder - New SidPlay2 decoder for SID (Hendrik Iben) - New Modplug decoder (Hendrik Iben) - New WavPack decoder (Alexandrov Sergey) - Renamed SndFile plugin for consistancy - Removed M4A format support from AAC decoder plugin - Removed WAV format support from ModPlug decoder plugin - Detect huge files in certain formats which SndFile cannot play - Improved (drastically in some cases) the accuracy of AAC durations * Overhauled FFmpeg/LibAV decoder: - Resolved FFmpeg API deprecations - Provided LibAV compatibility - Provided proper stereo downmixing - Provided locking support for non-thread-safe library functions - Provided better FFmpeg or LibAV discrimination - Provided better audio duration reliability determination - Increased number of decodable formats (including Xiph Opus) - Added decoding of audio from video formats - Added logging of FFmpeg/LibAV messages - Added seeking in most (but not all) formats - Added handling for "planar" codecs - Excluded experimental codecs from decoding - Fixed misreporting of tags, duration and bitrates - Fixed memory and file descriptor leakages - Fixed severe distortion on 8-bit samples - Fixed loop playing FLAC files - Fixed many FFmpeg/LibAV API breakages - Fixed many miscellaneous bugs - Detect over-length (and therefore broken) WAV files - Fixed log formatting when FFmpeg messages contain newline characters * Audio reproduction changes: - Improved support for 8-bit sample size - Added software mixer (Hendrik Iben) - Added parametric equalizer (Hendrik Iben) - Fixed many bugs which produced distorted sound - Fixed bugs in 24-bit sample handling (Tomasz Golinski) * General configuration file changes: - Reconciled and regularised example config and keymap files - Introduced lists and function-like syntax - Introduced variable substitution - Introduced symbol and boolean option types - Improved security of the configuration file - Automatic clearing of an overridden default key binding - Made processing of keymap file consistant with that of config file * Changed configuration file options: - Layout# options moved to a list and function-like syntax - SoundDriver option moved to a list syntax - Renamed OSSMixerChannel to OSSMixerChannel1 - Renamed ALSAMixer to ALSAMixer1 - QueueNextSongReturn moved to yes/no values - TagsCacheSize set to zero now disables tag caching * New configuration file options: - OnSongChange: run an external command (Jack Miller) - RepeatSongChange: govern the running of the OnSongChange command - OnStop: run an external command on stopping - EnforceTagsEncoding: substitutes ID3v1TagsEncoding for ISO-8859-1 encoding in ID3v2 tags (Aleks Sherikov) - FileNamesIconv: converts from local to UTF8 encoding for file names (Aleks Sherikov) - NonUTFXterm: converts UTF8 to local encoding for X-Term titles (Aleks Sherikov) - AutoLoadLyrics: says whether MOC should look for lyrics files - PreferredDecoders: allow finer control over decoder selection - XTerms: externalises terminals regarded as X-Terms - UseMIMEMagic: says whether to identify audio files by using MIME - JackStartServer: autostart JACK the server (Max Klinger) - ShowTimePercent: set the percent played state (Daniel T. Borelli) - Various options for SidPlay2, Modplug and TiMidity support * New command line options: - '-j' to jump to some position in the current track (Nuno Cardoso) - '-O' to override configuration file settings - '-Q' to display user formatted information (Juho Hämäläinen) - '-q' to queue files from command line (Martin Milata) - '-t' and '--on/off' to toggle or set playback options (Jack Miller) - '-v' to set the volume (Jack Miller) * Screen handling changes: - Changed minimum screen height to 7 lines (Tero Marttila) - Added support for GNU screen title (Jonathan Derque) - Restored screen to console mode after reporting fatal errors - Populated playlist panel when loading default playlist file - Removed default playlist autofocus at start - Fixed overlength highlight bar - Fixed screen upset when tags contain control characters - Fixed some screen upsets when tags contain UTF-8 characters (firejox) - Fixed screen upset caused by screen(1) mis-detection * New and updated client interaction features: - 'a' command: also add a directory to the playlist (Filippo Giunchedi) - 'L' command: display music lyrics (Géraud Le Falher) - 'Y' command: prune unreadable files from the playlist (tyranix) - Queued messages for display in the message area - Added play queue (Martin Milata) - Mark a fragment of a file which can be passed to external commands - Clear status message after a stream open failure - Minor help menu clarifications * Improve text entry history and editting: - Recognise ^u (by default) as delete to start of line - Recognise ^k (by default) as delete to end of line - Save and restore entered text prior to history scrolling - Save history entry modifications - Do not save adjacent duplicate entries - Do not save or modify with blank entries - Position cursor at end of restored or history line * Theme changes: - Enabled highlighted playlist numbers and file times (Marc Tschiesche) - Fixed miscoloured frame when switching themes (Alexander Polakov) - Fixed default colour settings - Fixed cursor placement in themes menu (Alex Merenstein) - Fixed ordering of theme files in themes menu - Fixed new attributes application on theme switching (Alex Merenstein) * General code cleaning: - Refactoring, optimisations and cosmetic improvements - Silenced many build warnings and errors - Replaced various deprecated, legacy and platform-specific functions - Improved thread safety * Significant bug fixes: - Fixed stale locks freeze in tags cache database following a crash - Fixed CURL timeout for internet streaming errors (Daniel Stenberg) - Fixed audio distortion on MP3 file having overly long tag values - Fixed false positive stream detection in the MP3 decoder - Fixed Ogg/Vorbis stream detection in the Vorbis decoder - Fixed 'LRINTF error' raised when reconfiguring MOC - Fixed backspace key mishandling - Fixed client interface meta-key handling - Fixed pthread stack overflow segfault on OpenBSD - Fixed segfault when text entry history becomes full - Fixed segfault processing playlists with relative paths - Fixed memory corruptions when toggling tag reading - Fixed assertion when a second client is started - Fixed slow memory leak in client on long-playing streams - Fixed severe distortion on 11025Hz 16-bit mono audios - Fixed freeze at end of playing audio file - Fixed server crash when attempting to play a deleted file - Fixed MIME type detection on HTTP redirection - Fixed crash when mixer value is above 100% - Fixed handling of huge (greater than 2 GiB) files - Fixed sub-second audio truncation on ALSA - Fixed segfault when MIME-detected MP3 file has no "extension" - Fixed segfault when using '--format' without an audio playing - Workaround for streams that have the actual title as tags/comments - Indentified cause of "undefined symbol" build errors - Plugged all known memory and file descriptor leaks - Fixed nonsense duration values returned on some corrupt FLAC files - Fixed 'time >= 0' assertion at change of audio file - Fixed client event notification failure in some circumstances - Fixed client abort on duplicated playlist filenames - Fixed delayed client exit when server invokes long-running scripts (Alex Merenstein) - Fixed occasional server freeze on logging when running scripts - Fixed non-conforming 'User-Agent' HTTP request header * Miscellaneous: - Updated and reformatted mocp manpage and equalizer README file - Made many warning and error reports more informative and consistant - Better logging of more problem determination information - More informative version information display - Introduced MD5-based decoder verification tools - Improved compatibility with 64-bit systems - Improved compatibility with big-endian systems - Moved tags cache to a Berkeley DB - Integration of down-stream distribution patches - Fixed frames to duration calculations in ALSA - Fixed some mutex management bugs - Fixed many bugs which crashed MOC
Diffstat (limited to 'audio/moc')
-rw-r--r--audio/moc/Makefile36
-rw-r--r--audio/moc/PLIST7
-rw-r--r--audio/moc/distinfo18
-rw-r--r--audio/moc/options.mk23
-rw-r--r--audio/moc/patches/patch-ab19
-rw-r--r--audio/moc/patches/patch-ac12
-rw-r--r--audio/moc/patches/patch-ad38
-rw-r--r--audio/moc/patches/patch-decoder__plugins_vorbis_vorbis.m415
-rw-r--r--audio/moc/patches/patch-playlist__file.c56
9 files changed, 113 insertions, 111 deletions
diff --git a/audio/moc/Makefile b/audio/moc/Makefile
index fac943bace3..3fbd5607faf 100644
--- a/audio/moc/Makefile
+++ b/audio/moc/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.26 2015/08/18 07:31:02 wiz Exp $
+# $NetBSD: Makefile,v 1.27 2016/02/16 08:46:01 leot Exp $
-DISTNAME= moc-2.4.4
-PKGREVISION= 3
+DISTNAME= moc-2.5.0
CATEGORIES= audio
MASTER_SITES= http://ftp.daper.net/pub/soft/moc/stable/
EXTRACT_SUFX= .tar.bz2
@@ -9,17 +8,14 @@ EXTRACT_SUFX= .tar.bz2
MAINTAINER= peter.schuller@infidyne.com
HOMEPAGE= http://moc.daper.net/
COMMENT= Curses based console audio player
-
-CONFLICTS= moc-devel-[0-9]*
+LICENSE= gnu-gpl-v2
GNU_CONFIGURE= yes
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
-USE_NCURSES= yes
USE_TOOLS+= pkg-config
-
-# We require ncurses because with curses arrow key navigation is buggy
-CONFIGURE_ARGS+= --with-ncurses
+# XXX: Only needed to regen configure script
+#USE_TOOLS+= autoconf automake
SUBST_CLASSES+= oss
SUBST_STAGE.oss= pre-configure
@@ -27,21 +23,27 @@ SUBST_FILES.oss= config.example options.c
SUBST_SED.oss= -e s,/dev/dsp,${DEVOSSAUDIO},g
SUBST_MESSAGE.oss= Fixing hardcoded audio device.
-.include "options.mk"
-###
-### This target is [currently] for regenerating configure to add the
-### sched_get_priority_max check of librt.
-###
-#USE_TOOLS+= autoconf automake
+BUILDLINK_TRANSFORM+= l:db:db4
+
+LDFLAGS.SunOS+= -lsocket
+
+# ${PREFIX}/bin/mocp contains path to pkg-config in work/.tools/.
+# It is harmless.
+CHECK_WRKREF_SKIP= bin/mocp
+
+# XXX: This target is [currently] for regenerating configure to add the
+# XXX: sched_get_priority_max check of librt.
#pre-configure:
# cd ${WRKSRC} && autoreconf -v -i
-LIBS.SunOS+= -lsocket
+.include "options.mk"
.include "../../audio/libid3tag/buildlink3.mk"
.include "../../audio/libmad/buildlink3.mk"
+.include "../../databases/db4/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
-.include "../../devel/ncurses/buildlink3.mk"
+.include "../../devel/libltdl/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
.include "../../mk/oss.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/audio/moc/PLIST b/audio/moc/PLIST
index 4c76ead58f2..e85053a5d72 100644
--- a/audio/moc/PLIST
+++ b/audio/moc/PLIST
@@ -1,12 +1,13 @@
-@comment $NetBSD: PLIST,v 1.4 2009/06/14 17:32:18 joerg Exp $
+@comment $NetBSD: PLIST,v 1.5 2016/02/16 08:46:01 leot Exp $
bin/mocp
${PLIST.flac}lib/moc/decoder_plugins/libflac_decoder.la
lib/moc/decoder_plugins/libmp3_decoder.la
-${PLIST.vorbis}lib/moc/decoder_plugins/libvorbis_decoder.la
-${PLIST.sndfile}lib/moc/decoder_plugins/libsndfile_formats_decoder.la
+${PLIST.sndfile}lib/moc/decoder_plugins/libsndfile_decoder.la
${PLIST.speex}lib/moc/decoder_plugins/libspeex_decoder.la
+${PLIST.vorbis}lib/moc/decoder_plugins/libvorbis_decoder.la
man/man1/mocp.1
share/doc/moc/README
+share/doc/moc/README_equalizer
share/doc/moc/THANKS
share/doc/moc/config.example
share/doc/moc/keymap.example
diff --git a/audio/moc/distinfo b/audio/moc/distinfo
index f50278169b6..20de3dc7541 100644
--- a/audio/moc/distinfo
+++ b/audio/moc/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.10 2015/11/03 01:12:41 agc Exp $
+$NetBSD: distinfo,v 1.11 2016/02/16 08:46:01 leot Exp $
-SHA1 (moc-2.4.4.tar.bz2) = e56ee13aa17c177f0afc42efe3804ebbbf46d4db
-RMD160 (moc-2.4.4.tar.bz2) = d757650b3d8ed4f830212f41d12af7144ecba29b
-SHA512 (moc-2.4.4.tar.bz2) = 0145d85d0fdd2c3c96392dcc2e9e73a6609a1dc6d710bee9bb82cc357b2f140d3de238079b3990934c72ec2d8276bc5f7d84c6db830f1e62ccdc15d654d4fca4
-Size (moc-2.4.4.tar.bz2) = 699724 bytes
-SHA1 (patch-ab) = 91c80cc251cd1c245613e3c41907629a7934bda3
-SHA1 (patch-ac) = 3a1ef7b9249c4e6818e434065ed3537d883e0e6a
-SHA1 (patch-ad) = 9a242fdc116fa173354d4ebd93d624c8c4580b6a
-SHA1 (patch-playlist__file.c) = 1026a40068a75e5076d3b6d661e5c47f7f0a418e
+SHA1 (moc-2.5.0.tar.bz2) = a02c10075541995771dbdccb7f2d0ecd19d70b81
+RMD160 (moc-2.5.0.tar.bz2) = 0c5d927b7c8ef54338ff6970f9e5d4f71dcb6168
+SHA512 (moc-2.5.0.tar.bz2) = ca6cfd4d1d13030bd561df8ab671399a17dfb675c360ecc95a2491c6a85764d0f72259ac33665405b197f370f4fd7ef59d9a485706f8a882bff30d0fafcf252c
+Size (moc-2.5.0.tar.bz2) = 594532 bytes
+SHA1 (patch-ab) = 37a3cc45df7b528613ce5c714c95895988f1570c
+SHA1 (patch-ad) = 4d4d73f819717698b37ca937477989b010adb5c8
+SHA1 (patch-decoder__plugins_vorbis_vorbis.m4) = 50f2967146be40a6d6b881cdffe5f25c4c226175
+SHA1 (patch-playlist__file.c) = cc2d5280992d713c846bfe16e8869238df6dca5d
diff --git a/audio/moc/options.mk b/audio/moc/options.mk
index 5aab6a4ed1d..9d6618a884f 100644
--- a/audio/moc/options.mk
+++ b/audio/moc/options.mk
@@ -1,22 +1,37 @@
-# $NetBSD: options.mk,v 1.5 2008/05/24 23:05:27 tnn Exp $
+# $NetBSD: options.mk,v 1.6 2016/02/16 08:46:01 leot Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.moc
-PKG_SUPPORTED_OPTIONS= sndfile flac vorbis speex curl samplerate
+PKG_SUPPORTED_OPTIONS= sndfile flac vorbis speex curl samplerate jack
PKG_SUGGESTED_OPTIONS= sndfile flac vorbis curl
.include "../../mk/bsd.options.mk"
PLIST_VARS+= flac sndfile speex vorbis
+.if !empty(PKG_OPTIONS:Mjack)
+CONFIGURE_ARGS+= --with-jack
+###
+### Resampling support is usually required with jack.
+###
+. include "../../audio/jack/buildlink3.mk"
+. if empty(PKG_OPTIONS:Msamplerate)
+PKG_OPTIONS+= samplerate
+. endif
+.else
+CONFIGURE_ARGS+= --without-jack
+.endif
+
.if !empty(PKG_OPTIONS:Msamplerate)
-PKG_OPTIONS+= sndfile
CONFIGURE_ARGS+= --with-samplerate
+. if empty(PKG_OPTIONS:Msndfile)
+PKG_OPTIONS+= sndfile
+. endif
. include "../../audio/libsamplerate/buildlink3.mk"
.else
CONFIGURE_ARGS+= --without-samplerate
.endif
-.if !empty(PKG_OPTIONS:Msndfile) || defined(PKG_OPTIONS:Msamplerate)
+.if !empty(PKG_OPTIONS:Msndfile)
PLIST.sndfile= yes
CONFIGURE_ARGS+= --with-sndfile
. include "../../audio/libsndfile/buildlink3.mk"
diff --git a/audio/moc/patches/patch-ab b/audio/moc/patches/patch-ab
index 5f8257ec901..cae4bfd183b 100644
--- a/audio/moc/patches/patch-ab
+++ b/audio/moc/patches/patch-ab
@@ -1,19 +1,12 @@
-$NetBSD: patch-ab,v 1.2 2011/09/04 14:31:58 joerg Exp $
+$NetBSD: patch-ab,v 1.3 2016/02/16 08:46:01 leot Exp $
---- configure.in.orig 2007-07-30 15:48:41.000000000 +0000
+Check for sched_get_priority_max being in -lrt.
+
+--- configure.in.orig 2014-08-30 02:32:27.000000000 +0000
+++ configure.in
-@@ -39,7 +39,7 @@ case "$OS" in
- ;;
- esac
-
--LDFLAGS="$LDFLAGS -export-dynamic"
-+LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
-
- AC_HEADER_STDC
- AC_CHECK_HEADERS([fcntl.h string.h strings.h sys/param.h unistd.h sys/un.h \
-@@ -49,7 +49,10 @@ AC_CHECK_HEADERS([fcntl.h string.h strin
+@@ -95,7 +95,10 @@ AC_CHECK_HEADERS([fcntl.h string.h strin
AC_MSG_ERROR([Can't find required header files.]))
- AC_CHECK_HEADERS([sys/select.h inttypes.h limits.h stdint.h])
+ AC_CHECK_HEADERS([sys/select.h byteswap.h])
-AC_CHECK_FUNCS([sched_get_priority_max])
+AC_CHECK_FUNCS([sched_get_priority_max], ,
diff --git a/audio/moc/patches/patch-ac b/audio/moc/patches/patch-ac
deleted file mode 100644
index 3651a8005f7..00000000000
--- a/audio/moc/patches/patch-ac
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ac,v 1.2 2013/06/16 13:00:59 ryoon Exp $
-
---- Makefile.in.orig 2009-01-04 08:35:54.000000000 +0000
-+++ Makefile.in
-@@ -278,6 +278,7 @@ sys_symbol_underscore = @sys_symbol_unde
- sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- SUBDIRS = themes decoder_plugins libltdl
-+ACLOCAL_AMFLAGS = -I m4
- AM_CPPFLAGS = -DSYSTEM_THEMES_DIR=\"$(pkgdatadir)/themes\" \
- -DPLUGIN_DIR=\"$(plugindir)/$(DECODER_PLUGIN_DIR)\" \
- $(LTDLINCL)
diff --git a/audio/moc/patches/patch-ad b/audio/moc/patches/patch-ad
index f10f5dcc5f3..e8c8bc17c7e 100644
--- a/audio/moc/patches/patch-ad
+++ b/audio/moc/patches/patch-ad
@@ -1,18 +1,13 @@
-$NetBSD: patch-ad,v 1.2 2011/09/04 14:31:58 joerg Exp $
+$NetBSD: patch-ad,v 1.3 2016/02/16 08:46:01 leot Exp $
---- configure.orig 2007-07-30 15:49:11.000000000 +0000
+regen after patching configure.in:
+
+- check for sched_get_priority_max being in -lrt
+
+--- configure.orig 2014-08-30 02:35:05.000000000 +0000
+++ configure
-@@ -21998,7 +21998,7 @@ _ACEOF
- ;;
- esac
-
--LDFLAGS="$LDFLAGS -export-dynamic"
-+LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
-
- { echo "$as_me:$LINENO: checking for ANSI C header files" >&5
- echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-@@ -22583,6 +22583,72 @@ if test `eval echo '${'$as_ac_var'}'` =
- #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+@@ -24142,6 +24142,72 @@ eval as_val=\$$as_ac_var
+ #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
+else
@@ -84,3 +79,20 @@ $NetBSD: patch-ad,v 1.2 2011/09/04 14:31:58 joerg Exp $
fi
done
+@@ -25065,6 +25131,7 @@ if ac_fn_c_try_link "$LINENO"; then :
+ mp_cv_ncursesw=yes
+ else
+ mp_cv_ncursesw=no
++ LIBS="$mp_save_LIBS"
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+@@ -28271,7 +28338,7 @@ if test "${with_vorbis+set}" = set; then
+ fi
+
+
+-if test "x$with_vorbis" == "xtremor"
++if test "x$with_vorbis" = "xtremor"
+ then
+
+ pkg_failed=no
diff --git a/audio/moc/patches/patch-decoder__plugins_vorbis_vorbis.m4 b/audio/moc/patches/patch-decoder__plugins_vorbis_vorbis.m4
new file mode 100644
index 00000000000..10f77e03745
--- /dev/null
+++ b/audio/moc/patches/patch-decoder__plugins_vorbis_vorbis.m4
@@ -0,0 +1,15 @@
+$NetBSD: patch-decoder__plugins_vorbis_vorbis.m4,v 1.1 2016/02/16 08:46:01 leot Exp $
+
+Avoid the use of "==" operator in test(1).
+
+--- decoder_plugins/vorbis/vorbis.m4.orig 2012-07-05 06:51:44.000000000 +0000
++++ decoder_plugins/vorbis/vorbis.m4
+@@ -3,7 +3,7 @@ dnl vorbis
+ AC_ARG_WITH(vorbis, AS_HELP_STRING([--without-vorbis],
+ [Compile without Ogg Vorbis support]))
+
+-if test "x$with_vorbis" == "xtremor"
++if test "x$with_vorbis" = "xtremor"
+ then
+ PKG_CHECK_MODULES(OGG_VORBIS,
+ [vorbisidec >= 1.0],
diff --git a/audio/moc/patches/patch-playlist__file.c b/audio/moc/patches/patch-playlist__file.c
index 2ddbeea3fab..2a5c72dfdda 100644
--- a/audio/moc/patches/patch-playlist__file.c
+++ b/audio/moc/patches/patch-playlist__file.c
@@ -1,52 +1,28 @@
-$NetBSD: patch-playlist__file.c,v 1.1 2012/01/11 19:06:25 hans Exp $
+$NetBSD: patch-playlist__file.c,v 1.2 2016/02/16 08:46:01 leot Exp $
---- playlist_file.c.orig 2007-07-30 16:58:46.000000000 +0200
-+++ playlist_file.c 2011-12-30 17:36:48.654368031 +0100
-@@ -91,8 +91,10 @@ static int plist_load_m3u (struct plist
+--- playlist_file.c.orig 2014-08-30 02:31:51.000000000 +0000
++++ playlist_file.c
+@@ -90,9 +90,11 @@ static int plist_load_m3u (struct plist
return 0;
}
+#ifndef __sun
- if (flock(fileno(file), LOCK_SH) == -1)
- logit ("Can't flock() the playlist file: %s", strerror(errno));
+ /* Lock gets released by fclose(). */
+ if (flock (fileno (file), LOCK_SH) == -1)
+ logit ("Can't flock() the playlist file: %s", strerror (errno));
+#endif
- while ((line = read_line(file))) {
- if (!strncmp(line, "#EXTINF:", sizeof("#EXTINF:")-1)) {
-@@ -190,9 +192,12 @@ static int plist_load_m3u (struct plist
- free (line);
- }
-
-+#ifndef __sun
- if (flock(fileno(file), LOCK_UN) == -1)
- logit ("Can't flock() (unlock) the playlist file: %s",
- strerror(errno));
-+#endif
-+
- fclose (file);
-
- return added;
-@@ -432,8 +437,10 @@ static int plist_save_m3u (struct plist
+ while ((line = read_line (file))) {
+ if (!strncmp (line, "#EXTINF:", sizeof("#EXTINF:") - 1)) {
+@@ -411,9 +413,11 @@ static int plist_save_m3u (struct plist
return 0;
}
+#ifndef __sun
- if (flock(fileno(file), LOCK_EX) == -1)
- logit ("Can't flock() the playlist file: %s", strerror(errno));
+ /* Lock gets released by fclose(). */
+ if (flock (fileno (file), LOCK_EX) == -1)
+ logit ("Can't flock() the playlist file: %s", strerror (errno));
+#endif
-
- if (fprintf(file, "#EXTM3U\r\n") < 0) {
- error ("Error writing playlist: %s", strerror(errno));
-@@ -481,9 +488,12 @@ static int plist_save_m3u (struct plist
- }
- }
-
-+#ifndef __sun
- if (flock(fileno(file), LOCK_UN) == -1)
- logit ("Can't flock() (unlock) the playlist file: %s",
- strerror(errno));
-+#endif
-+
- if (fclose(file)) {
- error ("Error writing playlist: %s", strerror(errno));
- return 0;
+
+ if (fprintf (file, "#EXTM3U\r\n") < 0) {
+ error ("Error writing playlist: %s", strerror (errno));