[Pkg-mpd-commits] [pkg-mpd] 01/03: Imported Upstream version 0.18.10

Florian Schlichting fsfs at moszumanska.debian.org
Thu Apr 10 18:30:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

fsfs pushed a commit to branch master
in repository pkg-mpd.

commit 2f4f5d96f459b6232adce2c8df326bf1612b41e7
Author: Florian Schlichting <fsfs at debian.org>
Date:   Thu Apr 10 20:21:39 2014 +0200

    Imported Upstream version 0.18.10
---
 Makefile.in                          |  2 +-
 NEWS                                 |  8 ++++++++
 aclocal.m4                           |  3 ++-
 configure                            | 21 +++++++++++----------
 configure.ac                         |  2 +-
 doc/doxygen.conf                     |  2 +-
 src/PlaylistEdit.cxx                 | 18 ++++++++----------
 src/decoder/FfmpegDecoderPlugin.cxx  | 29 ++++++++++++++++++++++++++---
 src/decoder/GmeDecoderPlugin.cxx     |  1 +
 src/decoder/SndfileDecoderPlugin.cxx | 26 ++++++++++++++++++++------
 10 files changed, 79 insertions(+), 33 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 726908a..998d0f2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -10296,9 +10296,9 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
- at ENABLE_DOCUMENTATION_FALSE@install-data-local:
 @ENABLE_DOCUMENTATION_FALSE at clean-local:
 @ENABLE_DOCUMENTATION_FALSE at uninstall-local:
+ at ENABLE_DOCUMENTATION_FALSE@install-data-local:
 clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic clean-local \
diff --git a/NEWS b/NEWS
index 7a3173f..d87626b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+ver 0.18.10 (2014/04/10)
+* decoder
+  - ffmpeg: fix seeking bug
+  - ffmpeg: handle unknown stream start time
+  - gme: fix memory leak
+  - sndfile: work around libsndfile bug on partial read
+* don't interrupt playback when current song gets deleted
+
 ver 0.18.9 (2014/03/02)
 * protocol
   - "findadd" requires the "add" permission
diff --git a/aclocal.m4 b/aclocal.m4
index f1711ed..8f9ada1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -573,7 +573,8 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
diff --git a/configure b/configure
index 4987a18..9fc8e3b 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.18.9.
+# Generated by GNU Autoconf 2.69 for mpd 0.18.10.
 #
 # Report bugs to <mpd-devel at musicpd.org>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mpd'
 PACKAGE_TARNAME='mpd'
-PACKAGE_VERSION='0.18.9'
-PACKAGE_STRING='mpd 0.18.9'
+PACKAGE_VERSION='0.18.10'
+PACKAGE_STRING='mpd 0.18.10'
 PACKAGE_BUGREPORT='mpd-devel at musicpd.org'
 PACKAGE_URL=''
 
@@ -1673,7 +1673,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.18.9 to adapt to many kinds of systems.
+\`configure' configures mpd 0.18.10 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1743,7 +1743,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mpd 0.18.9:";;
+     short | recursive ) echo "Configuration of mpd 0.18.10:";;
    esac
   cat <<\_ACEOF
 
@@ -2041,7 +2041,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mpd configure 0.18.9
+mpd configure 0.18.10
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2494,7 +2494,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.18.9, which was
+It was created by mpd $as_me 0.18.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3364,7 +3364,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mpd'
- VERSION='0.18.9'
+ VERSION='0.18.10'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3456,6 +3456,7 @@ END
     as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
   fi
 fi
+
 # Check whether --enable-silent-rules was given.
 if test "${enable_silent_rules+set}" = set; then :
   enableval=$enable_silent_rules;
@@ -18460,7 +18461,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.18.9, which was
+This file was extended by mpd $as_me 0.18.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18526,7 +18527,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.18.9
+mpd config.status 0.18.10
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 81bdcea..ae3a234 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 AC_PREREQ(2.60)
 
-AC_INIT(mpd, 0.18.9, mpd-devel at musicpd.org)
+AC_INIT(mpd, 0.18.10, mpd-devel at musicpd.org)
 
 VERSION_MAJOR=0
 VERSION_MINOR=18
diff --git a/doc/doxygen.conf b/doc/doxygen.conf
index 86080f4..7ba773d 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.18.9
+PROJECT_NUMBER = 0.18.10
 
 # 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/PlaylistEdit.cxx b/src/PlaylistEdit.cxx
index 668612a..3eea249 100644
--- a/src/PlaylistEdit.cxx
+++ b/src/PlaylistEdit.cxx
@@ -234,12 +234,8 @@ playlist::DeleteInternal(PlayerControl &pc,
 	if (playing && current == (int)songOrder) {
 		const bool paused = pc.GetState() == PlayerState::PAUSE;
 
-		/* the current song is going to be deleted: stop the player */
-
-		pc.Stop();
-		playing = false;
-
-		/* see which song is going to be played instead */
+		/* the current song is going to be deleted: see which
+		   song is going to be played instead */
 
 		current = queue.GetNextOrder(current);
 		if (current == (int)songOrder)
@@ -248,10 +244,12 @@ playlist::DeleteInternal(PlayerControl &pc,
 		if (current >= 0 && !paused)
 			/* play the song after the deleted one */
 			PlayOrder(pc, current);
-		else
-			/* no songs left to play, stop playback
-			   completely */
-			Stop(pc);
+		else {
+			/* stop the player */
+
+			pc.Stop();
+			playing = false;
+		}
 
 		*queued_p = nullptr;
 	} else if (current == (int)songOrder)
diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx
index 593f42d..bcb1ae3 100644
--- a/src/decoder/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/FfmpegDecoderPlugin.cxx
@@ -197,6 +197,29 @@ time_to_ffmpeg(double t, const AVRational time_base)
 			    time_base);
 }
 
+/**
+ * Replace #AV_NOPTS_VALUE with the given fallback.
+ */
+static constexpr int64_t
+timestamp_fallback(int64_t t, int64_t fallback)
+{
+	return gcc_likely(t != int64_t(AV_NOPTS_VALUE))
+		? t
+		: fallback;
+}
+
+/**
+ * Accessor for AVStream::start_time that replaces AV_NOPTS_VALUE with
+ * zero.  We can't use AV_NOPTS_VALUE in calculations, and we simply
+ * assume that the stream's start time is zero, which appears to be
+ * the best way out of that situation.
+ */
+static int64_t
+start_time_fallback(const AVStream &stream)
+{
+	return timestamp_fallback(stream.start_time, 0);
+}
+
 static void
 copy_interleave_frame2(uint8_t *dest, uint8_t **src,
 		       unsigned nframes, unsigned nchannels,
@@ -263,7 +286,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
 {
 	if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE)
 		decoder_timestamp(decoder,
-				  time_from_ffmpeg(packet->pts - stream->start_time,
+				  time_from_ffmpeg(packet->pts - start_time_fallback(*stream),
 				  stream->time_base));
 
 	AVPacket packet2 = *packet;
@@ -493,10 +516,10 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 			int64_t where =
 				time_to_ffmpeg(decoder_seek_where(decoder),
 					       av_stream->time_base) +
-				av_stream->start_time;
+				start_time_fallback(*av_stream);
 
 			if (av_seek_frame(format_context, audio_stream, where,
-					  AV_TIME_BASE) < 0)
+					  AVSEEK_FLAG_ANY) < 0)
 				decoder_seek_error(decoder);
 			else {
 				avcodec_flush_buffers(codec_context);
diff --git a/src/decoder/GmeDecoderPlugin.cxx b/src/decoder/GmeDecoderPlugin.cxx
index 815fd8d..d67ee4b 100644
--- a/src/decoder/GmeDecoderPlugin.cxx
+++ b/src/decoder/GmeDecoderPlugin.cxx
@@ -117,6 +117,7 @@ gme_container_scan(const char *path_fs, const unsigned int tnum)
 	}
 
 	const unsigned num_songs = gme_track_count(emu);
+	gme_delete(emu);
 	/* if it only contains a single tune, don't treat as container */
 	if (num_songs < 2)
 		return nullptr;
diff --git a/src/decoder/SndfileDecoderPlugin.cxx b/src/decoder/SndfileDecoderPlugin.cxx
index 3360cd1..77b1329 100644
--- a/src/decoder/SndfileDecoderPlugin.cxx
+++ b/src/decoder/SndfileDecoderPlugin.cxx
@@ -55,14 +55,28 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
 {
 	InputStream &is = *(InputStream *)user_data;
 
+	sf_count_t total_bytes = 0;
 	Error error;
-	size_t nbytes = is.LockRead(ptr, count, error);
-	if (nbytes == 0 && error.IsDefined()) {
-		LogError(error);
-		return -1;
-	}
 
-	return nbytes;
+	/* this loop is necessary because libsndfile chokes on partial
+	   reads */
+
+	do {
+		size_t nbytes = is.LockRead((char *)ptr + total_bytes,
+					    count - total_bytes, error);
+		if (nbytes == 0) {
+			if (error.IsDefined()) {
+				LogError(error);
+				return -1;
+			}
+
+			break;
+		}
+
+		total_bytes += nbytes;
+	} while (total_bytes < count);
+
+	return total_bytes;
 }
 
 static sf_count_t

-- 
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