[Pkg-mpd-commits] [pkg-mpd] 02/10: Imported Upstream version 0.19.10

Florian Schlichting fsfs at moszumanska.debian.org
Mon Jun 22 22:15:46 UTC 2015


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

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

commit 5328f80528b7bd0a0ecac824739750e6ffb3e726
Author: Florian Schlichting <fsfs at debian.org>
Date:   Mon Jun 22 21:53:19 2015 +0200

    Imported Upstream version 0.19.10
---
 Makefile.in                                 |  2 +-
 NEWS                                        | 15 ++++++
 configure                                   | 22 ++++----
 configure.ac                                |  4 +-
 doc/doxygen.conf                            |  2 +-
 src/PlayerThread.cxx                        |  6 +++
 src/decoder/DecoderAPI.cxx                  |  9 ++--
 src/decoder/DecoderThread.cxx               |  6 ++-
 src/decoder/plugins/FfmpegDecoderPlugin.cxx | 79 +++++++++++++++++++++++++----
 src/encoder/plugins/OpusEncoderPlugin.cxx   |  2 +-
 src/input/plugins/CurlInputPlugin.cxx       |  2 +
 src/input/plugins/SmbclientInputPlugin.cxx  |  1 +
 src/output/OutputControl.cxx                |  3 +-
 src/storage/plugins/NfsStorage.cxx          |  4 +-
 src/system/PeriodClock.hxx                  |  2 +-
 15 files changed, 126 insertions(+), 33 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 5d4d4ec..466351e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13891,8 +13891,8 @@ 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:
+ at ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE at clean-local:
 @ENABLE_DOCUMENTATION_FALSE at install-data-local:
 clean: clean-am
 
diff --git a/NEWS b/NEWS
index c03ef44..1d72d18 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+ver 0.19.10 (2015/06/21)
+* input
+  - curl: fix deadlock on small responses
+  - smbclient: fix DFF playback
+* decoder
+  - ffmpeg: improve seeking accuracy
+  - fix stuck stream tags
+* encoder
+  - opus: fix bogus granulepos
+* output
+  - fix failure to open device right after booting
+* neighbor
+  - nfs: fix deadlock when connecting
+* fix "single" mode breakage due to queue edits
+
 ver 0.19.9 (2015/02/06)
 * decoder
   - dsdiff, dsf: raise ID3 tag limit to 1 MB
diff --git a/configure b/configure
index bc93caa..84cd6c4 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.9.
+# Generated by GNU Autoconf 2.69 for mpd 0.19.10.
 #
 # 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.9'
-PACKAGE_STRING='mpd 0.19.9'
+PACKAGE_VERSION='0.19.10'
+PACKAGE_STRING='mpd 0.19.10'
 PACKAGE_BUGREPORT='musicpd-dev-team at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1746,7 +1746,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.9 to adapt to many kinds of systems.
+\`configure' configures mpd 0.19.10 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1816,7 +1816,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mpd 0.19.9:";;
+     short | recursive ) echo "Configuration of mpd 0.19.10:";;
    esac
   cat <<\_ACEOF
 
@@ -2157,7 +2157,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mpd configure 0.19.9
+mpd configure 0.19.10
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2610,7 +2610,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.9, which was
+It was created by mpd $as_me 0.19.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2961,7 +2961,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 VERSION_MAJOR=0
 VERSION_MINOR=19
-VERSION_REVISION=9
+VERSION_REVISION=10
 VERSION_EXTRA=0
 
 
@@ -3480,7 +3480,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mpd'
- VERSION='0.19.9'
+ VERSION='0.19.10'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20878,7 +20878,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.9, which was
+This file was extended by mpd $as_me 0.19.10, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20944,7 +20944,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.9
+mpd config.status 0.19.10
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 47882fa..1a3471f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,10 @@
 AC_PREREQ(2.60)
 
-AC_INIT(mpd, 0.19.9, musicpd-dev-team at lists.sourceforge.net)
+AC_INIT(mpd, 0.19.10, musicpd-dev-team at lists.sourceforge.net)
 
 VERSION_MAJOR=0
 VERSION_MINOR=19
-VERSION_REVISION=9
+VERSION_REVISION=10
 VERSION_EXTRA=0
 
 AC_CONFIG_SRCDIR([src/Main.cxx])
diff --git a/doc/doxygen.conf b/doc/doxygen.conf
index 22f4c43..37ecef3 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.9
+PROJECT_NUMBER = 0.19.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/PlayerThread.cxx b/src/PlayerThread.cxx
index c5308e6..eeebcdb 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -612,6 +612,12 @@ Player::ProcessCommand()
 
 		queued = true;
 		pc.CommandFinished();
+
+		pc.Unlock();
+		if (dc.LockIsIdle())
+			StartDecoder(*new MusicPipe());
+		pc.Lock();
+
 		break;
 
 	case PlayerCommand::PAUSE:
diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx
index 4794d60..941d3a7 100644
--- a/src/decoder/DecoderAPI.cxx
+++ b/src/decoder/DecoderAPI.cxx
@@ -433,8 +433,11 @@ update_stream_tag(Decoder &decoder, InputStream *is)
 
 		/* no stream tag present - submit the song tag
 		   instead */
-		decoder.song_tag = nullptr;
-	}
+	} else
+		/* discard the song tag; we don't need it */
+		delete decoder.song_tag;
+
+	decoder.song_tag = nullptr;
 
 	delete decoder.stream_tag;
 	decoder.stream_tag = tag;
@@ -566,7 +569,7 @@ decoder_tag(Decoder &decoder, InputStream *is,
 	/* save the tag */
 
 	delete decoder.decoder_tag;
-	decoder.decoder_tag = new Tag(tag);
+	decoder.decoder_tag = new Tag(std::move(tag));
 
 	/* check for a new stream tag */
 
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index dd5518b..b4362a5 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -380,7 +380,11 @@ decoder_run_song(DecoderControl &dc,
 		 const DetachedSong &song, const char *uri, Path path_fs)
 {
 	Decoder decoder(dc, dc.start_time.IsPositive(),
-			new Tag(song.GetTag()));
+			/* pass the song tag only if it's
+			   authoritative, i.e. if it's a local file -
+			   tags on "stream" songs are just remembered
+			   from the last time we played it*/
+			song.IsFile() ? new Tag(song.GetTag()) : nullptr);
 	int ret;
 
 	dc.state = DecoderState::START;
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 722f954..d5191a3 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -305,20 +305,60 @@ copy_interleave_frame(const AVCodecContext *codec_context,
 	return data_size;
 }
 
+/**
+ * Convert AVPacket::pts to a stream-relative time stamp (still in
+ * AVStream::time_base units).  Returns a negative value on error.
+ */
+gcc_pure
+static int64_t
+StreamRelativePts(const AVPacket &packet, const AVStream &stream)
+{
+	auto pts = packet.pts;
+	if (pts < 0 || pts == int64_t(AV_NOPTS_VALUE))
+		return -1;
+
+	auto start = start_time_fallback(stream);
+	return pts - start;
+}
+
+/**
+ * Convert a non-negative stream-relative time stamp in
+ * AVStream::time_base units to a PCM frame number.
+ */
+gcc_pure
+static uint64_t
+PtsToPcmFrame(uint64_t pts, const AVStream &stream,
+	      const AVCodecContext &codec_context)
+{
+	return av_rescale_q(pts, stream.time_base, codec_context.time_base);
+}
+
+/**
+ * @param min_frame skip all data before this PCM frame number; this
+ * is used after seeking to skip data in an AVPacket until the exact
+ * desired time stamp has been reached
+ */
 static DecoderCommand
 ffmpeg_send_packet(Decoder &decoder, InputStream &is,
 		   const AVPacket *packet,
 		   AVCodecContext *codec_context,
 		   const AVStream *stream,
 		   AVFrame *frame,
+		   uint64_t min_frame, size_t pcm_frame_size,
 		   uint8_t **buffer, int *buffer_size)
 {
-	if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE) {
-		auto start = start_time_fallback(*stream);
-		if (packet->pts >= start)
+	size_t skip_bytes = 0;
+
+	const auto pts = StreamRelativePts(*packet, *stream);
+	if (pts >= 0) {
+		if (min_frame > 0) {
+			auto cur_frame = PtsToPcmFrame(pts, *stream,
+						       *codec_context);
+			if (cur_frame < min_frame)
+				skip_bytes = pcm_frame_size * (min_frame - cur_frame);
+		} else
 			decoder_timestamp(decoder,
-					  time_from_ffmpeg(packet->pts - start,
-							   stream->time_base));
+					  time_from_ffmpeg(pts, stream->time_base));
 	}
 
 	AVPacket packet2 = *packet;
@@ -354,8 +394,20 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
 		if (audio_size <= 0)
 			continue;
 
+		const uint8_t *data = output_buffer;
+		if (skip_bytes > 0) {
+			if (skip_bytes >= size_t(audio_size)) {
+				skip_bytes -= audio_size;
+				continue;
+			}
+
+			data += skip_bytes;
+			audio_size -= skip_bytes;
+			skip_bytes = 0;
+		}
+
 		cmd = decoder_data(decoder, is,
-				   output_buffer, audio_size,
+				   data, audio_size,
 				   codec_context->bit_rate / 1000);
 	}
 	return cmd;
@@ -559,6 +611,8 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 	uint8_t *interleaved_buffer = nullptr;
 	int interleaved_buffer_size = 0;
 
+	uint64_t min_frame = 0;
+
 	DecoderCommand cmd;
 	do {
 		AVPacket packet;
@@ -566,13 +620,15 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 			/* end of file */
 			break;
 
-		if (packet.stream_index == audio_stream)
+		if (packet.stream_index == audio_stream) {
 			cmd = ffmpeg_send_packet(decoder, input,
 						 &packet, codec_context,
 						 av_stream,
 						 frame,
+						 min_frame, audio_format.GetFrameSize(),
 						 &interleaved_buffer, &interleaved_buffer_size);
-		else
+			min_frame = 0;
+		} else
 			cmd = decoder_get_command(decoder);
 
 		av_free_packet(&packet);
@@ -583,11 +639,16 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 					       av_stream->time_base) +
 				start_time_fallback(*av_stream);
 
+			/* AVSEEK_FLAG_BACKWARD asks FFmpeg to seek to
+			   the packet boundary before the seek time
+			   stamp, not after */
+
 			if (av_seek_frame(format_context, audio_stream, where,
-					  AVSEEK_FLAG_ANY) < 0)
+					  AVSEEK_FLAG_ANY|AVSEEK_FLAG_BACKWARD) < 0)
 				decoder_seek_error(decoder);
 			else {
 				avcodec_flush_buffers(codec_context);
+				min_frame = decoder_seek_where_frame(decoder);
 				decoder_command_finished(decoder);
 			}
 		}
diff --git a/src/encoder/plugins/OpusEncoderPlugin.cxx b/src/encoder/plugins/OpusEncoderPlugin.cxx
index 27b614b..2b52228 100644
--- a/src/encoder/plugins/OpusEncoderPlugin.cxx
+++ b/src/encoder/plugins/OpusEncoderPlugin.cxx
@@ -66,7 +66,7 @@ struct opus_encoder {
 
 	ogg_int64_t granulepos;
 
-	opus_encoder():encoder(opus_encoder_plugin) {}
+	opus_encoder():encoder(opus_encoder_plugin), granulepos(0) {}
 };
 
 static constexpr Domain opus_encoder_domain("opus_encoder");
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx
index abb7e31..3aa3b00 100644
--- a/src/input/plugins/CurlInputPlugin.cxx
+++ b/src/input/plugins/CurlInputPlugin.cxx
@@ -453,6 +453,8 @@ CurlInputStream::RequestDone(CURLcode result, long status)
 		SeekDone();
 	else if (!IsReady())
 		SetReady();
+	else
+		cond.broadcast();
 }
 
 static void
diff --git a/src/input/plugins/SmbclientInputPlugin.cxx b/src/input/plugins/SmbclientInputPlugin.cxx
index 7998718..3996137 100644
--- a/src/input/plugins/SmbclientInputPlugin.cxx
+++ b/src/input/plugins/SmbclientInputPlugin.cxx
@@ -132,6 +132,7 @@ SmbclientInputStream::Read(void *ptr, size_t read_size, Error &error)
 		nbytes = 0;
 	}
 
+	offset += nbytes;
 	return nbytes;
 }
 
diff --git a/src/output/OutputControl.cxx b/src/output/OutputControl.cxx
index 89428fa..9eafdb1 100644
--- a/src/output/OutputControl.cxx
+++ b/src/output/OutputControl.cxx
@@ -184,7 +184,8 @@ AudioOutput::LockUpdate(const AudioFormat audio_format,
 	const ScopeLock protect(mutex);
 
 	if (enabled && really_enabled) {
-		if (fail_timer.Check(REOPEN_AFTER * 1000)) {
+		if (!fail_timer.IsDefined() ||
+		    fail_timer.Check(REOPEN_AFTER * 1000)) {
 			return Open(audio_format, mp);
 		}
 	} else if (IsOpen())
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index 324b40b..a1f079e 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -177,6 +177,8 @@ private:
 				mutex.unlock();
 				DeferredMonitor::Schedule();
 				mutex.lock();
+				if (state == State::INITIAL)
+					cond.wait(mutex);
 				break;
 
 			case State::CONNECTING:
@@ -188,8 +190,6 @@ private:
 				error.Set(last_error);
 				return false;
 			}
-
-			cond.wait(mutex);
 		}
 	}
 
diff --git a/src/system/PeriodClock.hxx b/src/system/PeriodClock.hxx
index 1ba74ec..2c535fe 100644
--- a/src/system/PeriodClock.hxx
+++ b/src/system/PeriodClock.hxx
@@ -63,7 +63,7 @@ protected:
   }
 
 public:
-  bool IsDefined() const {
+  constexpr bool IsDefined() const {
     return last != 0;
   }
 

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