[Pkg-mpd-commits] [pkg-mpd] 02/06: Imported Upstream version 0.19.15

Florian Schlichting fsfs at moszumanska.debian.org
Sun May 1 16:47:27 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 3fe9dd7678c9272a59d45a3aa6685e514e9868bf
Author: Florian Schlichting <fsfs at debian.org>
Date:   Sat Apr 30 23:27:02 2016 +0200

    Imported Upstream version 0.19.15
---
 Makefile.am                                 |  4 +-
 Makefile.in                                 |  5 +-
 NEWS                                        |  9 ++++
 configure                                   | 22 ++++-----
 configure.ac                                |  4 +-
 doc/developer.xml                           |  5 +-
 doc/doxygen.conf                            |  2 +-
 doc/mpd.conf.5                              | 12 -----
 doc/mpdconf.example                         |  2 +-
 doc/protocol.xml                            | 24 +++++++++-
 doc/user.xml                                | 47 +++++++++++++++++--
 src/decoder/DecoderBuffer.hxx               |  1 +
 src/decoder/DecoderThread.cxx               |  4 ++
 src/decoder/plugins/FfmpegDecoderPlugin.cxx | 73 +++++++++++++++--------------
 src/decoder/plugins/OpusDecoderPlugin.cxx   | 10 ++--
 src/encoder/plugins/WaveEncoderPlugin.cxx   |  8 ++--
 src/notify.hxx                              |  2 +-
 test/test_byte_reverse.cxx                  |  8 ++--
 18 files changed, 159 insertions(+), 83 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 307fcba..00b425d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2109,7 +2109,9 @@ developer_DATA = $(wildcard doc/developer/*.html)
 
 DOCBOOK_HTML = $(patsubst %.xml,%/index.html,$(DOCBOOK_FILES))
 
-$(DOCBOOK_HTML): %/index.html: %.xml
+DOCBOOK_INCLUDES = $(wildcard $(srcdir)/doc/include/*.xml)
+
+$(DOCBOOK_HTML): %/index.html: %.xml $(DOCBOOK_INCLUDES)
 	$(XMLTO) -o $(@D) --stringparam chunker.output.encoding=utf-8 html --stringparam use.id.as.filename=1 $<
 
 doc/api/html/index.html: doc/doxygen.conf
diff --git a/Makefile.in b/Makefile.in
index 14f4bb4..5a3916a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4273,6 +4273,7 @@ DOCBOOK_FILES = doc/protocol.xml doc/user.xml doc/developer.xml
 @ENABLE_DOCUMENTATION_TRUE at developerdir = $(docdir)/developer
 @ENABLE_DOCUMENTATION_TRUE at developer_DATA = $(wildcard doc/developer/*.html)
 @ENABLE_DOCUMENTATION_TRUE at DOCBOOK_HTML = $(patsubst %.xml,%/index.html,$(DOCBOOK_FILES))
+ at ENABLE_DOCUMENTATION_TRUE@DOCBOOK_INCLUDES = $(wildcard $(srcdir)/doc/include/*.xml)
 
 #
 # Distribution
@@ -13902,9 +13903,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 ENABLE_DOCUMENTATION_FALSE@install-data-local:
 @ENABLE_DOCUMENTATION_FALSE at uninstall-local:
 @ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE at clean-local:
+ at ENABLE_DOCUMENTATION_FALSE@install-data-local:
 clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic clean-local \
@@ -14063,7 +14064,7 @@ uninstall-man: uninstall-man1 uninstall-man5
 src/win32/mpd_win32_rc.$(OBJEXT): src/win32/mpd_win32_rc.rc
 	$(WINDRES) -i $< -o $@
 
- at ENABLE_DOCUMENTATION_TRUE@$(DOCBOOK_HTML): %/index.html: %.xml
+ at ENABLE_DOCUMENTATION_TRUE@$(DOCBOOK_HTML): %/index.html: %.xml $(DOCBOOK_INCLUDES)
 @ENABLE_DOCUMENTATION_TRUE@	$(XMLTO) -o $(@D) --stringparam chunker.output.encoding=utf-8 html --stringparam use.id.as.filename=1 $<
 
 @ENABLE_DOCUMENTATION_TRUE at doc/api/html/index.html: doc/doxygen.conf
diff --git a/NEWS b/NEWS
index 0762ce4..051f808 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+ver 0.19.15 (2016/04/30)
+* decoder
+  - ffmpeg: support FFmpeg 3.0
+  - ffmpeg: use as fallback instead of "mad" if no plugin matches
+  - opus: support bigger OpusTags packets
+* fix more build failures on non-glibc builds due to constexpr Mutex
+* fix build failure due to missing include
+* fix unit test on Alpha
+
 ver 0.19.14 (2016/03/18)
 * decoder
   - dsdiff: fix off-by-one buffer overflow
diff --git a/configure b/configure
index 083c090..b7ad43b 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.14.
+# Generated by GNU Autoconf 2.69 for mpd 0.19.15.
 #
 # 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.14'
-PACKAGE_STRING='mpd 0.19.14'
+PACKAGE_VERSION='0.19.15'
+PACKAGE_STRING='mpd 0.19.15'
 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.14 to adapt to many kinds of systems.
+\`configure' configures mpd 0.19.15 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.14:";;
+     short | recursive ) echo "Configuration of mpd 0.19.15:";;
    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.14
+mpd configure 0.19.15
 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.14, which was
+It was created by mpd $as_me 0.19.15, 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=14
+VERSION_REVISION=15
 VERSION_EXTRA=0
 
 
@@ -3492,7 +3492,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mpd'
- VERSION='0.19.14'
+ VERSION='0.19.15'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20901,7 +20901,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.14, which was
+This file was extended by mpd $as_me 0.19.15, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20967,7 +20967,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.14
+mpd config.status 0.19.15
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 66621e6..c94c724 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,10 @@
 AC_PREREQ(2.60)
 
-AC_INIT(mpd, 0.19.14, musicpd-dev-team at lists.sourceforge.net)
+AC_INIT(mpd, 0.19.15, musicpd-dev-team at lists.sourceforge.net)
 
 VERSION_MAJOR=0
 VERSION_MINOR=19
-VERSION_REVISION=14
+VERSION_REVISION=15
 VERSION_EXTRA=0
 
 AC_CONFIG_SRCDIR([src/Main.cxx])
diff --git a/doc/developer.xml b/doc/developer.xml
index aa3cc62..074c7f3 100644
--- a/doc/developer.xml
+++ b/doc/developer.xml
@@ -1,6 +1,7 @@
 <?xml version='1.0' encoding="utf-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-               "docbook/dtd/xml/4.2/docbookx.dtd">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                      "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
 <book>
   <title>The Music Player Daemon - Developer's Manual</title>
 
diff --git a/doc/doxygen.conf b/doc/doxygen.conf
index 701f806..40d8ac6 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.14
+PROJECT_NUMBER = 0.19.15
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
diff --git a/doc/mpd.conf.5 b/doc/mpd.conf.5
index 0cd6c31..805f9e4 100644
--- a/doc/mpd.conf.5
+++ b/doc/mpd.conf.5
@@ -174,18 +174,6 @@ MP3 playback.
 This specifies whether relative or absolute paths for song filenames are used
 when saving playlists.  The default is "no".
 .TP
-.B metadata_to_use <tags>
-This specifies the tag types that will be scanned for and made available to
-clients.  Note that you must recreate (not update) your database for changes to
-this parameter to take effect.  Possible values are artist, album, title,
-track, name, genre, date, composer, performer, comment, disc,
-musicbrainz_artistid, musicbrainz_albumid, musicbrainz_albumartistid,
-musicbrainz_releasetrackid, musicbrainz_trackid.  Multiple tags may be specified
-as a comma separated list.
-An example value is "artist,album,title,track".  The special value "none" may
-be used alone to disable all metadata.  The default is to use all known tag
-types except for comments and those starting with "musicbrainz".
-.TP
 .B auto_update <yes or no>
 This specifies the whether to support automatic update of music database when
 files are changed in music_directory. The default is to disable autoupdate
diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index 4b55f88..6ba0351 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
@@ -115,7 +115,7 @@
 #
 # This setting defines a list of tag types that will be extracted during the
 # audio file discovery process. The complete list of possible values can be
-# found in the mpd.conf man page.
+# found in the user manual.
 #metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc"
 #
 # This setting enables automatic update of MPD's database when files in 
diff --git a/doc/protocol.xml b/doc/protocol.xml
index 839aa2d..ac78ab8 100644
--- a/doc/protocol.xml
+++ b/doc/protocol.xml
@@ -1,6 +1,7 @@
 <?xml version='1.0' encoding="utf-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-               "docbook/dtd/xml/4.2/docbookx.dtd">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                      "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
 <book>
   <title>The Music Player Daemon protocol</title>
 
@@ -201,6 +202,25 @@
         omitted, then the maximum possible value is assumed.
       </para>
     </section>
+
+    <section id="tags">
+      <title>Tags</title>
+
+      <para>
+        The following tags are supported by
+        <application>MPD</application>:
+      </para>
+
+      <xi:include href="include/tags.xml"
+                  xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+      <para>
+        There can be multiple values for some of these tags.  For
+        example, <application>MPD</application> may return multiple
+        lines with a <varname>performer</varname> tag.  A tag value is
+        a UTF-8 string.
+      </para>
+    </section>
   </chapter>
 
   <chapter id="recipes">
diff --git a/doc/user.xml b/doc/user.xml
index 5a60dc6..f4317f3 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -1,6 +1,7 @@
 <?xml version='1.0' encoding="utf-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-               "docbook/dtd/xml/4.2/docbookx.dtd">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+                      "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
 <book>
   <title>The Music Player Daemon - User's Manual</title>
 
@@ -16,7 +17,7 @@
       <application>MPD</application> (Music Player Daemon) is, as the
       name suggests, a server software allowing you to remotely play
       your music, handle playlists, deliver music (HTTP streams with
-      various sub-protocols) and organizze playlists.
+      various sub-protocols) and organize playlists.
     </para>
 
     <para>
@@ -944,6 +945,33 @@ systemctl start mpd.socket</programlisting>
     <section id="config_other">
       <title>Other Settings</title>
 
+      <informaltable>
+        <tgroup cols="2">
+          <thead>
+            <row>
+              <entry>Setting</entry>
+              <entry>Description</entry>
+            </row>
+          </thead>
+          <tbody>
+            <row>
+              <entry>
+                <varname>metadata_to_use</varname>
+                <parameter>TAG1,TAG2,...</parameter>
+              </entry>
+              <entry>
+                Use only the specified tags, and ignore the others.
+                This setting can reduce the database size and
+                <application>MPD</application>'s memory usage by
+                omitting unused tags.  By default, all tags but
+                <varname>comment</varname> are enabled.  The special
+                value "none" disables all tags.
+              </entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </informaltable>
+
       <section>
         <title>The State File</title>
 
@@ -1297,6 +1325,19 @@ database {
       </para>
     </section>
 
+    <section id="tags">
+      <title>Metadata</title>
+
+      <para>
+        When scanning or playing a song,
+        <application>MPD</application> parses its metadata.  The
+        following tags are supported:
+      </para>
+
+      <xi:include href="include/tags.xml"
+                  xmlns:xi="http://www.w3.org/2001/XInclude"/>
+    </section>
+
     <section id="queue">
       <title>The queue</title>
 
diff --git a/src/decoder/DecoderBuffer.hxx b/src/decoder/DecoderBuffer.hxx
index 9cf47d9..db5b30e 100644
--- a/src/decoder/DecoderBuffer.hxx
+++ b/src/decoder/DecoderBuffer.hxx
@@ -25,6 +25,7 @@
 #include "util/ConstBuffer.hxx"
 
 #include <stddef.h>
+#include <stdint.h>
 
 struct Decoder;
 class InputStream;
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index b4362a5..d5f73c3 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -255,7 +255,11 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
 {
 	const struct DecoderPlugin *plugin;
 
+#ifdef HAVE_FFMPEG
+	plugin = decoder_plugin_from_name("ffmpeg");
+#else
 	plugin = decoder_plugin_from_name("mad");
+#endif
 	return plugin != nullptr && plugin->stream_decode != nullptr &&
 		decoder_stream_decode(*plugin, decoder, is);
 }
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 95525b6..6404450 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -199,10 +199,10 @@ ffmpeg_init(gcc_unused const config_param &param)
 }
 
 static int
-ffmpeg_find_audio_stream(const AVFormatContext *format_context)
+ffmpeg_find_audio_stream(const AVFormatContext &format_context)
 {
-	for (unsigned i = 0; i < format_context->nb_streams; ++i)
-		if (format_context->streams[i]->codec->codec_type ==
+	for (unsigned i = 0; i < format_context.nb_streams; ++i)
+		if (format_context.streams[i]->codec->codec_type ==
 		    AVMEDIA_TYPE_AUDIO)
 			return i;
 
@@ -276,22 +276,22 @@ copy_interleave_frame2(uint8_t *dest, uint8_t **src,
  * Copy PCM data from a AVFrame to an interleaved buffer.
  */
 static int
-copy_interleave_frame(const AVCodecContext *codec_context,
-		      const AVFrame *frame,
+copy_interleave_frame(const AVCodecContext &codec_context,
+		      const AVFrame &frame,
 		      uint8_t **output_buffer,
 		      uint8_t **global_buffer, int *global_buffer_size)
 {
 	int plane_size;
 	const int data_size =
 		av_samples_get_buffer_size(&plane_size,
-					   codec_context->channels,
-					   frame->nb_samples,
-					   codec_context->sample_fmt, 1);
+					   codec_context.channels,
+					   frame.nb_samples,
+					   codec_context.sample_fmt, 1);
 	if (data_size <= 0)
 		return data_size;
 
-	if (av_sample_fmt_is_planar(codec_context->sample_fmt) &&
-	    codec_context->channels > 1) {
+	if (av_sample_fmt_is_planar(codec_context.sample_fmt) &&
+	    codec_context.channels > 1) {
 		if(*global_buffer_size < data_size) {
 			av_freep(global_buffer);
 
@@ -303,12 +303,12 @@ copy_interleave_frame(const AVCodecContext *codec_context,
 			*global_buffer_size = data_size;
 		}
 		*output_buffer = *global_buffer;
-		copy_interleave_frame2(*output_buffer, frame->extended_data,
-				       frame->nb_samples,
-				       codec_context->channels,
-				       av_get_bytes_per_sample(codec_context->sample_fmt));
+		copy_interleave_frame2(*output_buffer, frame.extended_data,
+				       frame.nb_samples,
+				       codec_context.channels,
+				       av_get_bytes_per_sample(codec_context.sample_fmt));
 	} else {
-		*output_buffer = frame->extended_data[0];
+		*output_buffer = frame.extended_data[0];
 	}
 
 	return data_size;
@@ -349,41 +349,39 @@ PtsToPcmFrame(uint64_t pts, const AVStream &stream,
  */
 static DecoderCommand
 ffmpeg_send_packet(Decoder &decoder, InputStream &is,
-		   const AVPacket *packet,
-		   AVCodecContext *codec_context,
-		   const AVStream *stream,
+		   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)
 {
 	size_t skip_bytes = 0;
 
-	const auto pts = StreamRelativePts(*packet, *stream);
+	const auto pts = StreamRelativePts(packet, stream);
 	if (pts >= 0) {
 		if (min_frame > 0) {
-			auto cur_frame = PtsToPcmFrame(pts, *stream,
-						       *codec_context);
+			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(pts, stream->time_base));
+					  time_from_ffmpeg(pts, stream.time_base));
 	}
 
-	AVPacket packet2 = *packet;
-
 	uint8_t *output_buffer;
 
 	DecoderCommand cmd = DecoderCommand::NONE;
-	while (packet2.size > 0 && cmd == DecoderCommand::NONE) {
+	while (packet.size > 0 && cmd == DecoderCommand::NONE) {
 		int audio_size = 0;
 		int got_frame = 0;
-		int len = avcodec_decode_audio4(codec_context,
+		int len = avcodec_decode_audio4(&codec_context,
 						frame, &got_frame,
-						&packet2);
+						&packet);
 		if (len >= 0 && got_frame) {
 			audio_size = copy_interleave_frame(codec_context,
-							   frame,
+							   *frame,
 							   &output_buffer,
 							   buffer, buffer_size);
 			if (audio_size < 0)
@@ -397,8 +395,8 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
 			break;
 		}
 
-		packet2.data += len;
-		packet2.size -= len;
+		packet.data += len;
+		packet.size -= len;
 
 		if (audio_size <= 0)
 			continue;
@@ -417,7 +415,7 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
 
 		cmd = decoder_data(decoder, is,
 				   data, audio_size,
-				   codec_context->bit_rate / 1000);
+				   codec_context.bit_rate / 1000);
 	}
 	return cmd;
 }
@@ -535,7 +533,7 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 		return;
 	}
 
-	int audio_stream = ffmpeg_find_audio_stream(format_context);
+	int audio_stream = ffmpeg_find_audio_stream(*format_context);
 	if (audio_stream == -1) {
 		LogError(ffmpeg_domain, "No audio stream inside");
 		avformat_close_input(&format_context);
@@ -631,8 +629,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 
 		if (packet.stream_index == audio_stream) {
 			cmd = ffmpeg_send_packet(decoder, input,
-						 &packet, codec_context,
-						 av_stream,
+						 std::move(packet),
+						 *codec_context,
+						 *av_stream,
 						 frame,
 						 min_frame, audio_format.GetFrameSize(),
 						 &interleaved_buffer, &interleaved_buffer_size);
@@ -640,7 +639,11 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
 		} else
 			cmd = decoder_get_command(decoder);
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 25, 100)
+		av_packet_unref(&packet);
+#else
 		av_free_packet(&packet);
+#endif
 
 		if (cmd == DecoderCommand::SEEK) {
 			int64_t where =
@@ -709,7 +712,7 @@ ffmpeg_scan_stream(InputStream &is,
 	}
 
 	ffmpeg_scan_dictionary(f->metadata, handler, handler_ctx);
-	int idx = ffmpeg_find_audio_stream(f);
+	int idx = ffmpeg_find_audio_stream(*f);
 	if (idx >= 0)
 		ffmpeg_scan_dictionary(f->streams[idx]->metadata,
 				       handler, handler_ctx);
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx
index e14827e..3a7418a 100644
--- a/src/decoder/plugins/OpusDecoderPlugin.cxx
+++ b/src/decoder/plugins/OpusDecoderPlugin.cxx
@@ -441,13 +441,15 @@ mpd_opus_scan_stream(InputStream &is,
 	if (!oy.ExpectFirstPage(os))
 		return false;
 
-	/* read at most two more pages */
-	unsigned remaining_pages = 2;
+	/* read at most 64 more pages */
+	unsigned remaining_pages = 64;
+
+	unsigned remaining_packets = 4;
 
 	bool result = false;
 
 	ogg_packet packet;
-	while (true) {
+	while (remaining_packets > 0) {
 		int r = ogg_stream_packetout(&os, &packet);
 		if (r < 0) {
 			result = false;
@@ -466,6 +468,8 @@ mpd_opus_scan_stream(InputStream &is,
 			continue;
 		}
 
+		--remaining_packets;
+
 		if (packet.b_o_s) {
 			if (!IsOpusHead(packet))
 				break;
diff --git a/src/encoder/plugins/WaveEncoderPlugin.cxx b/src/encoder/plugins/WaveEncoderPlugin.cxx
index 97a26e8..c20069d 100644
--- a/src/encoder/plugins/WaveEncoderPlugin.cxx
+++ b/src/encoder/plugins/WaveEncoderPlugin.cxx
@@ -27,6 +27,8 @@
 #include <assert.h>
 #include <string.h>
 
+static constexpr uint16_t WAVE_FORMAT_PCM = 1;
+
 struct WaveEncoder {
 	Encoder encoder;
 	unsigned bits;
@@ -64,15 +66,15 @@ fill_wave_header(struct wave_header *header, int channels, int bits,
 	header->id_fmt = ToLE32(0x20746d66);
 	header->id_data = ToLE32(0x61746164);
 
-        /* wave format */
-	header->format = ToLE16(1); // PCM_FORMAT
+	/* wave format */
+	header->format = ToLE16(WAVE_FORMAT_PCM);
 	header->channels = ToLE16(channels);
 	header->bits = ToLE16(bits);
 	header->freq = ToLE32(freq);
 	header->blocksize = ToLE16(block_size);
 	header->byterate = ToLE32(freq * block_size);
 
-        /* chunk sizes (fake data length) */
+	/* chunk sizes (fake data length) */
 	header->fmt_size = ToLE32(16);
 	header->data_size = ToLE32(data_size);
 	header->riff_size = ToLE32(4 + (8 + 16) + (8 + data_size));
diff --git a/src/notify.hxx b/src/notify.hxx
index 3e62a01..c96390b 100644
--- a/src/notify.hxx
+++ b/src/notify.hxx
@@ -28,7 +28,7 @@ struct notify {
 	Cond cond;
 	bool pending;
 
-#if !defined(WIN32) && !defined(__NetBSD__) && !defined(__BIONIC__)
+#ifdef __GLIBC__
 	constexpr
 #endif
 	notify():pending(false) {}
diff --git a/test/test_byte_reverse.cxx b/test/test_byte_reverse.cxx
index 0ab97e4..d06a159 100644
--- a/test/test_byte_reverse.cxx
+++ b/test/test_byte_reverse.cxx
@@ -49,9 +49,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ByteReverseTest);
 void
 ByteReverseTest::TestByteReverse2()
 {
-	static const char src[] = "123456";
+	static const char src[] gcc_alignas(uint16_t, 2) = "123456";
 	static const char result[] = "214365";
-	static uint8_t dest[ARRAY_SIZE(src)];
+	static uint8_t dest[ARRAY_SIZE(src)] gcc_alignas(uint16_t, 2);
 
 	reverse_bytes(dest, (const uint8_t *)src,
 		      (const uint8_t *)(src + ARRAY_SIZE(src) - 1), 2);
@@ -73,9 +73,9 @@ ByteReverseTest::TestByteReverse3()
 void
 ByteReverseTest::TestByteReverse4()
 {
-	static const char src[] = "12345678";
+	static const char src[] gcc_alignas(uint32_t, 4) = "12345678";
 	static const char result[] = "43218765";
-	static uint8_t dest[ARRAY_SIZE(src)];
+	static uint8_t dest[ARRAY_SIZE(src)] gcc_alignas(uint32_t, 4);
 
 	reverse_bytes(dest, (const uint8_t *)src,
 		      (const uint8_t *)(src + ARRAY_SIZE(src) - 1), 4);

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