[Pkg-mpd-commits] [pkg-mpd] 01/03: Imported Upstream version 0.19.17
Florian Schlichting
fsfs at moszumanska.debian.org
Tue Jul 12 22:15:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
fsfs pushed a commit to branch master
in repository pkg-mpd.
commit cce75e157664556c3cc02b16c3d01b281d4e7b8c
Author: Florian Schlichting <fsfs at debian.org>
Date: Tue Jul 12 23:56:50 2016 +0200
Imported Upstream version 0.19.17
---
Makefile.am | 1 +
Makefile.in | 34 ++++++--
NEWS | 10 +++
build/config.guess | 111 ++++++++++++++------------
build/config.sub | 20 ++---
configure | 22 ++---
configure.ac | 4 +-
doc/doxygen.conf | 2 +-
src/PlayerThread.cxx | 11 ++-
src/client/ClientRead.cxx | 2 +-
src/decoder/DecoderAPI.cxx | 3 +-
src/decoder/plugins/FlacCommon.cxx | 90 ++++++++++-----------
src/decoder/plugins/FlacCommon.hxx | 24 ++----
src/decoder/plugins/FlacDecoderPlugin.cxx | 100 +++++++++++++----------
src/event/BufferedSocket.cxx | 8 +-
src/filter/plugins/ReplayGainFilterPlugin.cxx | 9 ++-
src/filter/plugins/RouteFilterPlugin.cxx | 7 +-
src/output/plugins/ShoutOutputPlugin.cxx | 1 -
src/pcm/Silence.cxx | 35 ++++++++
src/pcm/Silence.hxx | 36 +++++++++
src/pcm/Volume.cxx | 6 +-
21 files changed, 335 insertions(+), 201 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 91f0f32..7cd68f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -467,6 +467,7 @@ libpcm_a_SOURCES = \
src/pcm/PcmConvert.cxx src/pcm/PcmConvert.hxx \
src/pcm/PcmDop.cxx src/pcm/PcmDop.hxx \
src/pcm/Volume.cxx src/pcm/Volume.hxx \
+ src/pcm/Silence.cxx src/pcm/Silence.hxx \
src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx \
src/pcm/PcmChannels.cxx src/pcm/PcmChannels.hxx \
src/pcm/PcmPack.cxx src/pcm/PcmPack.hxx \
diff --git a/Makefile.in b/Makefile.in
index 9ed3a1c..840ba0c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1525,9 +1525,10 @@ am__libpcm_a_SOURCES_DIST = src/pcm/Domain.cxx src/pcm/Domain.hxx \
src/pcm/PcmExport.cxx src/pcm/PcmExport.hxx \
src/pcm/PcmConvert.cxx src/pcm/PcmConvert.hxx \
src/pcm/PcmDop.cxx src/pcm/PcmDop.hxx src/pcm/Volume.cxx \
- src/pcm/Volume.hxx src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx \
- src/pcm/PcmChannels.cxx src/pcm/PcmChannels.hxx \
- src/pcm/PcmPack.cxx src/pcm/PcmPack.hxx src/pcm/PcmFormat.cxx \
+ src/pcm/Volume.hxx src/pcm/Silence.cxx src/pcm/Silence.hxx \
+ src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx src/pcm/PcmChannels.cxx \
+ src/pcm/PcmChannels.hxx src/pcm/PcmPack.cxx \
+ src/pcm/PcmPack.hxx src/pcm/PcmFormat.cxx \
src/pcm/PcmFormat.hxx src/pcm/FloatConvert.hxx \
src/pcm/ShiftConvert.hxx src/pcm/Neon.hxx \
src/pcm/FormatConverter.cxx src/pcm/FormatConverter.hxx \
@@ -1553,6 +1554,7 @@ am_libpcm_a_OBJECTS = src/pcm/libpcm_a-Domain.$(OBJEXT) \
src/pcm/libpcm_a-PcmConvert.$(OBJEXT) \
src/pcm/libpcm_a-PcmDop.$(OBJEXT) \
src/pcm/libpcm_a-Volume.$(OBJEXT) \
+ src/pcm/libpcm_a-Silence.$(OBJEXT) \
src/pcm/libpcm_a-PcmMix.$(OBJEXT) \
src/pcm/libpcm_a-PcmChannels.$(OBJEXT) \
src/pcm/libpcm_a-PcmPack.$(OBJEXT) \
@@ -3281,9 +3283,10 @@ libpcm_a_SOURCES = src/pcm/Domain.cxx src/pcm/Domain.hxx \
src/pcm/PcmExport.cxx src/pcm/PcmExport.hxx \
src/pcm/PcmConvert.cxx src/pcm/PcmConvert.hxx \
src/pcm/PcmDop.cxx src/pcm/PcmDop.hxx src/pcm/Volume.cxx \
- src/pcm/Volume.hxx src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx \
- src/pcm/PcmChannels.cxx src/pcm/PcmChannels.hxx \
- src/pcm/PcmPack.cxx src/pcm/PcmPack.hxx src/pcm/PcmFormat.cxx \
+ src/pcm/Volume.hxx src/pcm/Silence.cxx src/pcm/Silence.hxx \
+ src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx src/pcm/PcmChannels.cxx \
+ src/pcm/PcmChannels.hxx src/pcm/PcmPack.cxx \
+ src/pcm/PcmPack.hxx src/pcm/PcmFormat.cxx \
src/pcm/PcmFormat.hxx src/pcm/FloatConvert.hxx \
src/pcm/ShiftConvert.hxx src/pcm/Neon.hxx \
src/pcm/FormatConverter.cxx src/pcm/FormatConverter.hxx \
@@ -5685,6 +5688,8 @@ src/pcm/libpcm_a-PcmDop.$(OBJEXT): src/pcm/$(am__dirstamp) \
src/pcm/$(DEPDIR)/$(am__dirstamp)
src/pcm/libpcm_a-Volume.$(OBJEXT): src/pcm/$(am__dirstamp) \
src/pcm/$(DEPDIR)/$(am__dirstamp)
+src/pcm/libpcm_a-Silence.$(OBJEXT): src/pcm/$(am__dirstamp) \
+ src/pcm/$(DEPDIR)/$(am__dirstamp)
src/pcm/libpcm_a-PcmMix.$(OBJEXT): src/pcm/$(am__dirstamp) \
src/pcm/$(DEPDIR)/$(am__dirstamp)
src/pcm/libpcm_a-PcmChannels.$(OBJEXT): src/pcm/$(am__dirstamp) \
@@ -6891,6 +6896,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-PcmFormat.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-PcmMix.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-PcmPack.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-Silence.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-SoxrResampler.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/$(DEPDIR)/libpcm_a-Volume.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at src/pcm/dsd2pcm/$(DEPDIR)/dsd2pcm.Po at am__quote@
@@ -11541,6 +11547,20 @@ src/pcm/libpcm_a-Volume.obj: src/pcm/Volume.cxx
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/pcm/libpcm_a-Volume.obj `if test -f 'src/pcm/Volume.cxx'; then $(CYGPATH_W) 'src/pcm/Volume.cxx'; else $(CYGPATH_W) '$(srcdir)/src/pcm/Volume.cxx'; fi`
+src/pcm/libpcm_a-Silence.o: src/pcm/Silence.cxx
+ at am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/pcm/libpcm_a-Silence.o -MD -MP -MF src/pcm/$(DEPDIR)/libpcm_a-Silence.Tpo -c -o src/pcm/libpcm_a-Silence.o `test -f 'src/pcm/Silence.cxx' || echo '$(srcdir)/'`src/pcm/Silence.cxx
+ at am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/pcm/$(DEPDIR)/libpcm_a-Silence.Tpo src/pcm/$(DEPDIR)/libpcm_a-Silence.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pcm/Silence.cxx' object='src/pcm/libpcm_a-Silence.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/pcm/libpcm_a-Silence.o `test -f 'src/pcm/Silence.cxx' || echo '$(srcdir)/'`src/pcm/Silence.cxx
+
+src/pcm/libpcm_a-Silence.obj: src/pcm/Silence.cxx
+ at am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/pcm/libpcm_a-Silence.obj -MD -MP -MF src/pcm/$(DEPDIR)/libpcm_a-Silence.Tpo -c -o src/pcm/libpcm_a-Silence.obj `if test -f 'src/pcm/Silence.cxx'; then $(CYGPATH_W) 'src/pcm/Silence.cxx'; else $(CYGPATH_W) '$(srcdir)/src/pcm/Silence.cxx'; fi`
+ at am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/pcm/$(DEPDIR)/libpcm_a-Silence.Tpo src/pcm/$(DEPDIR)/libpcm_a-Silence.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pcm/Silence.cxx' object='src/pcm/libpcm_a-Silence.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(AM_V_CXX at am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/pcm/libpcm_a-Silence.obj `if test -f 'src/pcm/Silence.cxx'; then $(CYGPATH_W) 'src/pcm/Silence.cxx'; else $(CYGPATH_W) '$(srcdir)/src/pcm/Silence.cxx'; fi`
+
src/pcm/libpcm_a-PcmMix.o: src/pcm/PcmMix.cxx
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpcm_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/pcm/libpcm_a-PcmMix.o -MD -MP -MF src/pcm/$(DEPDIR)/libpcm_a-PcmMix.Tpo -c -o src/pcm/libpcm_a-PcmMix.o `test -f 'src/pcm/PcmMix.cxx' || echo '$(srcdir)/'`src/pcm/PcmMix.cxx
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/pcm/$(DEPDIR)/libpcm_a-PcmMix.Tpo src/pcm/$(DEPDIR)/libpcm_a-PcmMix.Po
@@ -13904,9 +13924,9 @@ maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
- at ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE at clean-local:
@ENABLE_DOCUMENTATION_FALSE at uninstall-local:
@ENABLE_DOCUMENTATION_FALSE at install-data-local:
+ at ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE at clean-local:
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-local \
diff --git a/NEWS b/NEWS
index 73d2244..df7493f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+ver 0.19.17 (2016/07/09)
+* decoder
+ - flac: fix assertion failure while seeking
+ - flac: fix stream duration indicator
+ - fix seek problems in several plugins
+* fix spurious seek error "Failed to allocate silence buffer"
+* replay gain: fix "replay_gain_handler mixer" setting
+* DSD: use 0x69 as silence pattern
+* fix use-after-free bug on "close" and "kill"
+
ver 0.19.16 (2016/06/13)
* faster seeking
* fix system include path order
diff --git a/build/config.guess b/build/config.guess
index 1659250..0967f2a 100755
--- a/build/config.guess
+++ b/build/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2015 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2015-08-20'
+timestamp='2016-04-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ timestamp='2015-08-20'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to <config-patches at gnu.org>.
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -237,6 +237,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
@@ -268,42 +272,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@@ -376,16 +380,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
- SUN_ARCH="i386"
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -410,7 +414,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
@@ -635,13 +639,13 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
@@ -680,11 +684,11 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ ${HP_ARCH} = hppa2.0w ]
then
eval $set_cc_for_build
@@ -697,12 +701,12 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -807,14 +811,14 @@ EOF
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@@ -896,7 +900,7 @@ EOF
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
@@ -919,7 +923,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
@@ -965,6 +969,9 @@ EOF
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -1120,7 +1127,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1269,6 +1276,9 @@ EOF
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1282,9 +1292,9 @@ EOF
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
@@ -1306,7 +1316,7 @@ EOF
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
@@ -1337,7 +1347,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
@@ -1379,7 +1389,7 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
@@ -1390,6 +1400,9 @@ EOF
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
esac
cat >&2 <<EOF
@@ -1399,9 +1412,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/build/config.sub b/build/config.sub
index 1acc966..8d39c4b 100755
--- a/build/config.sub
+++ b/build/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2015 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2015-08-20'
+timestamp='2016-03-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ timestamp='2015-08-20'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -53,8 +53,7 @@ timestamp='2015-08-20'
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
@@ -68,7 +67,7 @@ Report bugs and patches to <config-patches at gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -521,7 +520,7 @@ case $basic_machine in
basic_machine=i386-pc
os=-aros
;;
- asmjs)
+ asmjs)
basic_machine=asmjs-unknown
;;
aux)
@@ -1383,7 +1382,7 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
@@ -1399,7 +1398,8 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1531,6 +1531,8 @@ case $os in
;;
-nacl*)
;;
+ -ios)
+ ;;
-none)
;;
*)
diff --git a/configure b/configure
index c674402..8389a30 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mpd 0.19.16.
+# Generated by GNU Autoconf 2.69 for mpd 0.19.17.
#
# Report bugs to <musicpd-dev-team at lists.sourceforge.net>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mpd'
PACKAGE_TARNAME='mpd'
-PACKAGE_VERSION='0.19.16'
-PACKAGE_STRING='mpd 0.19.16'
+PACKAGE_VERSION='0.19.17'
+PACKAGE_STRING='mpd 0.19.17'
PACKAGE_BUGREPORT='musicpd-dev-team at lists.sourceforge.net'
PACKAGE_URL=''
@@ -1757,7 +1757,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mpd 0.19.16 to adapt to many kinds of systems.
+\`configure' configures mpd 0.19.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1828,7 +1828,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mpd 0.19.16:";;
+ short | recursive ) echo "Configuration of mpd 0.19.17:";;
esac
cat <<\_ACEOF
@@ -2169,7 +2169,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mpd configure 0.19.16
+mpd configure 0.19.17
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2622,7 +2622,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mpd $as_me 0.19.16, which was
+It was created by mpd $as_me 0.19.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2973,7 +2973,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
VERSION_MAJOR=0
VERSION_MINOR=19
-VERSION_REVISION=16
+VERSION_REVISION=17
VERSION_EXTRA=0
@@ -3492,7 +3492,7 @@ fi
# Define the identity of the package.
PACKAGE='mpd'
- VERSION='0.19.16'
+ VERSION='0.19.17'
cat >>confdefs.h <<_ACEOF
@@ -20895,7 +20895,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mpd $as_me 0.19.16, which was
+This file was extended by mpd $as_me 0.19.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20961,7 +20961,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mpd config.status 0.19.16
+mpd config.status 0.19.17
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 35ecb7b..b5d59c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,10 @@
AC_PREREQ(2.60)
-AC_INIT(mpd, 0.19.16, musicpd-dev-team at lists.sourceforge.net)
+AC_INIT(mpd, 0.19.17, musicpd-dev-team at lists.sourceforge.net)
VERSION_MAJOR=0
VERSION_MINOR=19
-VERSION_REVISION=16
+VERSION_REVISION=17
VERSION_EXTRA=0
AC_CONFIG_SRCDIR([src/Main.cxx])
diff --git a/doc/doxygen.conf b/doc/doxygen.conf
index 483cee1..ac2bdae 100644
--- a/doc/doxygen.conf
+++ b/doc/doxygen.conf
@@ -31,7 +31,7 @@ PROJECT_NAME = MPD
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 0.19.16
+PROJECT_NUMBER = 0.19.17
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 30e509b..69bd088 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -25,6 +25,7 @@
#include "MusicPipe.hxx"
#include "MusicBuffer.hxx"
#include "MusicChunk.hxx"
+#include "pcm/Silence.hxx"
#include "DetachedSong.hxx"
#include "system/FatalError.hxx"
#include "CrossFade.hxx"
@@ -486,8 +487,12 @@ Player::SendSilence()
MusicChunk *chunk = buffer.Allocate();
if (chunk == nullptr) {
- LogError(player_domain, "Failed to allocate silence buffer");
- return false;
+ /* this is non-fatal, because this means that the
+ decoder has filled to buffer completely meanwhile;
+ by ignoring the error, we work around this race
+ condition */
+ LogDebug(player_domain, "Failed to allocate silence buffer");
+ return true;
}
#ifndef NDEBUG
@@ -501,7 +506,7 @@ Player::SendSilence()
chunk->time = SignedSongTime::Negative(); /* undefined time stamp */
chunk->length = num_frames * frame_size;
- memset(chunk->data, 0, chunk->length);
+ PcmSilence({chunk->data, chunk->length}, play_audio_format.format);
Error error;
if (!pc.outputs.Play(chunk, error)) {
diff --git a/src/client/ClientRead.cxx b/src/client/ClientRead.cxx
index 9cfb127..232da8d 100644
--- a/src/client/ClientRead.cxx
+++ b/src/client/ClientRead.cxx
@@ -52,8 +52,8 @@ Client::OnSocketInput(void *data, size_t length)
break;
case CommandResult::KILL:
- Close();
partition.instance.event_loop->Break();
+ Close();
return InputResult::CLOSED;
case CommandResult::FINISH:
diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx
index 941d3a7..d7c9bc7 100644
--- a/src/decoder/DecoderAPI.cxx
+++ b/src/decoder/DecoderAPI.cxx
@@ -301,7 +301,8 @@ decoder_check_cancel_read(const Decoder *decoder)
/* ignore the SEEK command during initialization, the plugin
should handle that after it has initialized successfully */
if (dc.command == DecoderCommand::SEEK &&
- (dc.state == DecoderState::START || decoder->seeking))
+ (dc.state == DecoderState::START || decoder->seeking ||
+ decoder->initial_seek_running))
return false;
return true;
diff --git a/src/decoder/plugins/FlacCommon.cxx b/src/decoder/plugins/FlacCommon.cxx
index e86f855..eaf4d8b 100644
--- a/src/decoder/plugins/FlacCommon.cxx
+++ b/src/decoder/plugins/FlacCommon.cxx
@@ -33,7 +33,7 @@ flac_data::flac_data(Decoder &_decoder,
InputStream &_input_stream)
:FlacInput(_input_stream, &_decoder),
initialized(false), unsupported(false),
- total_frames(0), first_frame(0), next_frame(0), position(0),
+ position(0),
decoder(_decoder), input_stream(_input_stream)
{
}
@@ -59,6 +59,38 @@ flac_sample_format(unsigned bits_per_sample)
}
}
+bool
+flac_data::Initialize(unsigned sample_rate, unsigned bits_per_sample,
+ unsigned channels, FLAC__uint64 total_frames)
+{
+ assert(!initialized);
+ assert(!unsupported);
+
+ ::Error error;
+ if (!audio_format_init_checked(audio_format,
+ sample_rate,
+ flac_sample_format(bits_per_sample),
+ channels, error)) {
+ LogError(error);
+ unsupported = true;
+ return false;
+ }
+
+ frame_size = audio_format.GetFrameSize();
+
+ const auto duration = total_frames > 0
+ ? SignedSongTime::FromScale<uint64_t>(total_frames,
+ audio_format.sample_rate)
+ : SignedSongTime::Negative();
+
+ decoder_initialized(decoder, audio_format,
+ input_stream.IsSeekable(),
+ duration);
+
+ initialized = true;
+ return true;
+}
+
static void
flac_got_stream_info(struct flac_data *data,
const FLAC__StreamMetadata_StreamInfo *stream_info)
@@ -66,22 +98,10 @@ flac_got_stream_info(struct flac_data *data,
if (data->initialized || data->unsupported)
return;
- Error error;
- if (!audio_format_init_checked(data->audio_format,
- stream_info->sample_rate,
- flac_sample_format(stream_info->bits_per_sample),
- stream_info->channels, error)) {
- LogError(error);
- data->unsupported = true;
- return;
- }
-
- data->frame_size = data->audio_format.GetFrameSize();
-
- if (data->total_frames == 0)
- data->total_frames = stream_info->total_samples;
-
- data->initialized = true;
+ data->Initialize(stream_info->sample_rate,
+ stream_info->bits_per_sample,
+ stream_info->channels,
+ stream_info->total_samples);
}
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
@@ -125,28 +145,11 @@ flac_got_first_frame(struct flac_data *data, const FLAC__FrameHeader *header)
if (data->unsupported)
return false;
- Error error;
- if (!audio_format_init_checked(data->audio_format,
- header->sample_rate,
- flac_sample_format(header->bits_per_sample),
- header->channels, error)) {
- LogError(error);
- data->unsupported = true;
- return false;
- }
-
- data->frame_size = data->audio_format.GetFrameSize();
-
- const auto duration = SongTime::FromScale<uint64_t>(data->total_frames,
- data->audio_format.sample_rate);
-
- decoder_initialized(data->decoder, data->audio_format,
- data->input_stream.IsSeekable(),
- duration);
-
- data->initialized = true;
-
- return true;
+ return data->Initialize(header->sample_rate,
+ header->bits_per_sample,
+ header->channels,
+ /* unknown duration */
+ 0);
}
FLAC__StreamDecoderWriteStatus
@@ -155,7 +158,6 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
FLAC__uint64 nbytes)
{
void *buffer;
- unsigned bit_rate;
if (!data->initialized && !flac_got_first_frame(data, &frame->header))
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
@@ -167,16 +169,12 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
data->audio_format.format, buf,
0, frame->header.blocksize);
- if (nbytes > 0)
- bit_rate = nbytes * 8 * frame->header.sample_rate /
- (1000 * frame->header.blocksize);
- else
- bit_rate = 0;
+ unsigned bit_rate = nbytes * 8 * frame->header.sample_rate /
+ (1000 * frame->header.blocksize);
auto cmd = decoder_data(data->decoder, data->input_stream,
buffer, buffer_size,
bit_rate);
- data->next_frame += frame->header.blocksize;
switch (cmd) {
case DecoderCommand::NONE:
case DecoderCommand::START:
diff --git a/src/decoder/plugins/FlacCommon.hxx b/src/decoder/plugins/FlacCommon.hxx
index 34ce0a3..593a5ad 100644
--- a/src/decoder/plugins/FlacCommon.hxx
+++ b/src/decoder/plugins/FlacCommon.hxx
@@ -55,23 +55,9 @@ struct flac_data : public FlacInput {
AudioFormat audio_format;
/**
- * The total number of frames in this song. The decoder
- * plugin may initialize this attribute to override the value
- * provided by libFLAC (e.g. for sub songs from a CUE sheet).
+ * End of last frame's position within the stream. This is
+ * used for bit rate calculations.
*/
- FLAC__uint64 total_frames;
-
- /**
- * The number of the first frame in this song. This is only
- * non-zero if playing sub songs from a CUE sheet.
- */
- FLAC__uint64 first_frame;
-
- /**
- * The number of the next frame which is going to be decoded.
- */
- FLAC__uint64 next_frame;
-
FLAC__uint64 position;
Decoder &decoder;
@@ -80,6 +66,12 @@ struct flac_data : public FlacInput {
Tag tag;
flac_data(Decoder &decoder, InputStream &input_stream);
+
+ /**
+ * Wrapper for decoder_initialized().
+ */
+ bool Initialize(unsigned sample_rate, unsigned bits_per_sample,
+ unsigned channels, FLAC__uint64 total_frames);
};
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx
index eea8134..c78b023 100644
--- a/src/decoder/plugins/FlacDecoderPlugin.cxx
+++ b/src/decoder/plugins/FlacDecoderPlugin.cxx
@@ -132,26 +132,16 @@ flac_decoder_new(void)
}
static bool
-flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
- FLAC__uint64 duration)
+flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd)
{
- data->total_frames = duration;
-
if (!FLAC__stream_decoder_process_until_end_of_metadata(sd)) {
- LogWarning(flac_domain, "problem reading metadata");
+ if (FLAC__stream_decoder_get_state(sd) != FLAC__STREAM_DECODER_END_OF_STREAM)
+ LogWarning(flac_domain, "problem reading metadata");
return false;
}
if (data->initialized) {
/* done */
-
- const auto duration2 =
- SongTime::FromScale<uint64_t>(data->total_frames,
- data->audio_format.sample_rate);
-
- decoder_initialized(data->decoder, data->audio_format,
- data->input_stream.IsSeekable(),
- duration2);
return true;
}
@@ -167,13 +157,10 @@ flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
}
static void
-flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
- FLAC__uint64 t_start, FLAC__uint64 t_end)
+flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec)
{
Decoder &decoder = data->decoder;
- data->first_frame = t_start;
-
while (true) {
DecoderCommand cmd;
if (!data->tag.IsEmpty()) {
@@ -184,24 +171,49 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
cmd = decoder_get_command(decoder);
if (cmd == DecoderCommand::SEEK) {
- FLAC__uint64 seek_sample = t_start +
+ FLAC__uint64 seek_sample =
decoder_seek_where_frame(decoder);
- if (seek_sample >= t_start &&
- (t_end == 0 || seek_sample <= t_end) &&
- FLAC__stream_decoder_seek_absolute(flac_dec, seek_sample)) {
- data->next_frame = seek_sample;
+ if (FLAC__stream_decoder_seek_absolute(flac_dec, seek_sample)) {
data->position = 0;
decoder_command_finished(decoder);
} else
decoder_seek_error(decoder);
- } else if (cmd == DecoderCommand::STOP ||
- FLAC__stream_decoder_get_state(flac_dec) == FLAC__STREAM_DECODER_END_OF_STREAM)
+ } else if (cmd == DecoderCommand::STOP)
break;
- if (t_end != 0 && data->next_frame >= t_end)
- /* end of this sub track */
+ switch (FLAC__stream_decoder_get_state(flac_dec)) {
+ case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA:
+ case FLAC__STREAM_DECODER_READ_METADATA:
+ case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
+ case FLAC__STREAM_DECODER_READ_FRAME:
+ /* continue decoding */
+ break;
+
+ case FLAC__STREAM_DECODER_END_OF_STREAM:
+ /* regular end of stream */
+ return;
+
+ case FLAC__STREAM_DECODER_SEEK_ERROR:
+ /* try to recover from seek error */
+ if (!FLAC__stream_decoder_flush(flac_dec)) {
+ LogError(flac_domain, "FLAC__stream_decoder_flush() failed");
+ return;
+ }
+
break;
+ case FLAC__STREAM_DECODER_OGG_ERROR:
+ case FLAC__STREAM_DECODER_ABORTED:
+ case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
+ /* an error, fatal enough for us to abort the
+ decoder */
+ return;
+
+ case FLAC__STREAM_DECODER_UNINITIALIZED:
+ /* we shouldn't see this, ever - bail out */
+ return;
+ }
+
if (!FLAC__stream_decoder_process_single(flac_dec) &&
decoder_get_command(decoder) == DecoderCommand::NONE) {
/* a failure that was not triggered by a
@@ -250,6 +262,24 @@ stream_init(FLAC__StreamDecoder *flac_dec, struct flac_data *data, bool is_ogg)
: stream_init_flac(flac_dec, data);
}
+static bool
+FlacInitAndDecode(struct flac_data &data, FLAC__StreamDecoder *sd, bool is_ogg)
+{
+ auto init_status = stream_init(sd, &data, is_ogg);
+ if (init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
+ LogWarning(flac_domain,
+ FLAC__StreamDecoderInitStatusString[init_status]);
+ return false;
+ }
+
+ bool result = flac_decoder_initialize(&data, sd);
+ if (result)
+ flac_decoder_loop(&data, sd);
+
+ FLAC__stream_decoder_finish(sd);
+ return result;
+}
+
static void
flac_decode_internal(Decoder &decoder,
InputStream &input_stream,
@@ -263,24 +293,8 @@ flac_decode_internal(Decoder &decoder,
struct flac_data data(decoder, input_stream);
- FLAC__StreamDecoderInitStatus status =
- stream_init(flac_dec, &data, is_ogg);
- if (status != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
- FLAC__stream_decoder_delete(flac_dec);
- LogWarning(flac_domain,
- FLAC__StreamDecoderInitStatusString[status]);
- return;
- }
-
- if (!flac_decoder_initialize(&data, flac_dec, 0)) {
- FLAC__stream_decoder_finish(flac_dec);
- FLAC__stream_decoder_delete(flac_dec);
- return;
- }
-
- flac_decoder_loop(&data, flac_dec, 0, 0);
+ FlacInitAndDecode(data, flac_dec, is_ogg);
- FLAC__stream_decoder_finish(flac_dec);
FLAC__stream_decoder_delete(flac_dec);
}
diff --git a/src/event/BufferedSocket.cxx b/src/event/BufferedSocket.cxx
index 939824b..1891f18 100644
--- a/src/event/BufferedSocket.cxx
+++ b/src/event/BufferedSocket.cxx
@@ -118,9 +118,15 @@ BufferedSocket::OnSocketReady(unsigned flags)
if (flags & READ) {
assert(!input.IsFull());
- if (!ReadToBuffer() || !ResumeInput())
+ if (!ReadToBuffer())
return false;
+ if (!ResumeInput())
+ /* we must return "true" here or
+ SocketMonitor::Dispatch() will call
+ Cancel() on a freed object */
+ return true;
+
if (!input.IsFull())
ScheduleRead();
}
diff --git a/src/filter/plugins/ReplayGainFilterPlugin.cxx b/src/filter/plugins/ReplayGainFilterPlugin.cxx
index f76e48e..b6f574b 100644
--- a/src/filter/plugins/ReplayGainFilterPlugin.cxx
+++ b/src/filter/plugins/ReplayGainFilterPlugin.cxx
@@ -134,8 +134,6 @@ ReplayGainFilter::Update()
volume = pcm_float_to_volume(scale);
}
- pv.SetVolume(volume);
-
if (mixer != nullptr) {
/* update the hardware mixer volume */
@@ -146,7 +144,8 @@ ReplayGainFilter::Update()
Error error;
if (!mixer_set_volume(mixer, _volume, error))
LogError(error, "Failed to update hardware mixer");
- }
+ } else
+ pv.SetVolume(volume);
}
static Filter *
@@ -174,7 +173,9 @@ ReplayGainFilter::Close()
ConstBuffer<void>
ReplayGainFilter::FilterPCM(ConstBuffer<void> src, gcc_unused Error &error)
{
- return pv.Apply(src);
+ return mixer != nullptr
+ ? src
+ : pv.Apply(src);
}
const struct filter_plugin replay_gain_filter_plugin = {
diff --git a/src/filter/plugins/RouteFilterPlugin.cxx b/src/filter/plugins/RouteFilterPlugin.cxx
index 4094119..e8bed6e 100644
--- a/src/filter/plugins/RouteFilterPlugin.cxx
+++ b/src/filter/plugins/RouteFilterPlugin.cxx
@@ -47,9 +47,11 @@
#include "filter/FilterInternal.hxx"
#include "filter/FilterRegistry.hxx"
#include "pcm/PcmBuffer.hxx"
+#include "pcm/Silence.hxx"
#include "util/StringUtil.hxx"
#include "util/Error.hxx"
#include "util/ConstBuffer.hxx"
+#include "util/WritableBuffer.hxx"
#include <algorithm>
@@ -266,9 +268,8 @@ RouteFilter::FilterPCM(ConstBuffer<void> src, gcc_unused Error &error)
(unsigned)sources[c] >= input_format.channels) {
// No source for this destination output,
// give it zeroes as input
- memset(chan_destination,
- 0x00,
- bytes_per_frame_per_channel);
+ PcmSilence({chan_destination, bytes_per_frame_per_channel},
+ input_format.format);
} else {
// Get the data from channel sources[c]
// and copy it to the output
diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx
index b51f7ed..406be8d 100644
--- a/src/output/plugins/ShoutOutputPlugin.cxx
+++ b/src/output/plugins/ShoutOutputPlugin.cxx
@@ -247,7 +247,6 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
{
char temp[11];
- memset(temp, 0, sizeof(temp));
snprintf(temp, sizeof(temp), "%u", audio_format.channels);
shout_set_audio_info(shout_conn, SHOUT_AI_CHANNELS, temp);
diff --git a/src/pcm/Silence.cxx b/src/pcm/Silence.cxx
new file mode 100644
index 0000000..c8f67f2
--- /dev/null
+++ b/src/pcm/Silence.cxx
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2003-2016 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "Silence.hxx"
+#include "AudioFormat.hxx"
+#include "util/WritableBuffer.hxx"
+
+#include <string.h>
+
+void
+PcmSilence(WritableBuffer<void> dest, SampleFormat format)
+{
+ uint8_t pattern = 0;
+ if (format == SampleFormat::DSD)
+ pattern = 0x69;
+
+ memset(dest.data, pattern, dest.size);
+}
diff --git a/src/pcm/Silence.hxx b/src/pcm/Silence.hxx
new file mode 100644
index 0000000..5fcf993
--- /dev/null
+++ b/src/pcm/Silence.hxx
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2003-2016 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MPD_PCM_SILENCE_HXX
+#define MPD_PCM_SILENCE_HXX
+
+#include "check.h"
+
+#include <stdint.h>
+
+template<typename T> struct WritableBuffer;
+enum class SampleFormat : uint8_t;
+
+/**
+ * Fill the given buffer with the format-specific silence pattern.
+ */
+void
+PcmSilence(WritableBuffer<void> dest, SampleFormat format);
+
+#endif
diff --git a/src/pcm/Volume.cxx b/src/pcm/Volume.cxx
index b12d8fd..6d28a9b 100644
--- a/src/pcm/Volume.cxx
+++ b/src/pcm/Volume.cxx
@@ -19,10 +19,12 @@
#include "config.h"
#include "Volume.hxx"
+#include "Silence.hxx"
#include "Domain.hxx"
#include "PcmUtils.hxx"
#include "Traits.hxx"
#include "util/ConstBuffer.hxx"
+#include "util/WritableBuffer.hxx"
#include "util/Error.hxx"
#include "PcmDither.cxx" // including the .cxx file to get inlined templates
@@ -134,9 +136,7 @@ PcmVolume::Apply(ConstBuffer<void> src)
if (volume == 0) {
/* optimized special case: 0% volume = memset(0) */
- /* TODO: is this valid for all sample formats? What
- about floating point? */
- memset(data, 0, src.size);
+ PcmSilence({data, src.size}, format);
return { data, src.size };
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/pkg-mpd.git
More information about the Pkg-mpd-commits
mailing list