[Pkg-mpd-commits] [SCM] Git repository for pkg-mpd branch, master, updated. debian/0.16.2-1-8-gd69655e

Alexander Wirt formorer at debian.org
Sun Jul 31 20:16:58 UTC 2011


The following commit has been merged in the master branch:
commit c887ddc0fe1492b1a702239aae144cdf6804bb97
Author: Alexander Wirt <formorer at debian.org>
Date:   Tue Jul 19 21:02:27 2011 +0200

    Imported Upstream version 0.16.3

diff --git a/NEWS b/NEWS
index 7bbb0fc..31169a8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,12 @@
+ver 0.16.3 (2011/06/04)
+* fix assertion failure in audio format mask parser
+* fix NULL pointer dereference in playlist parser
+* fix playlist files in base music directory
+* database: allow directories with just playlists
+* decoder:
+  - ffmpeg: support libavcodec 0.7
+
+
 ver 0.16.2 (2011/03/18)
 * configure.ac:
   - fix bashism in tremor test
@@ -143,6 +152,13 @@ ver 0.16 (2010/12/11)
 * make single mode 'sticky'
 
 
+ver 0.15.17 (2011/??/??)
+* encoder:
+  - vorbis: reset the Ogg stream after flush
+* decoders:
+  - vorbis: fix tremor support
+
+
 ver 0.15.16 (2011/03/13)
 * output:
   - ao: initialize the ao_sample_format struct
diff --git a/configure b/configure
index cae36a5..313bcd3 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.67 for mpd 0.16.2.
+# Generated by GNU Autoconf 2.67 for mpd 0.16.3.
 #
 # Report bugs to <musicpd-dev-team at lists.sourceforge.net>.
 #
@@ -552,8 +552,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mpd'
 PACKAGE_TARNAME='mpd'
-PACKAGE_VERSION='0.16.2'
-PACKAGE_STRING='mpd 0.16.2'
+PACKAGE_VERSION='0.16.3'
+PACKAGE_STRING='mpd 0.16.3'
 PACKAGE_BUGREPORT='musicpd-dev-team at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1591,7 +1591,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.16.2 to adapt to many kinds of systems.
+\`configure' configures mpd 0.16.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1661,7 +1661,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mpd 0.16.2:";;
+     short | recursive ) echo "Configuration of mpd 0.16.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1932,7 +1932,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mpd configure 0.16.2
+mpd configure 0.16.3
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2442,7 +2442,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.16.2, which was
+It was created by mpd $as_me 0.16.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -3258,7 +3258,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mpd'
- VERSION='0.16.2'
+ VERSION='0.16.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -11175,7 +11175,7 @@ if
 		as_fn_error $? "No input plugins supported!" "$LINENO" 5
 fi
 
- if test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes; then
+ if test x$enable_vorbis = xyes || test x$enable_tremor = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes; then
   HAVE_OGG_COMMON_TRUE=
   HAVE_OGG_COMMON_FALSE='#'
 else
@@ -14972,7 +14972,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.16.2, which was
+This file was extended by mpd $as_me 0.16.3, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15038,7 +15038,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.16.2
+mpd config.status 0.16.3
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 6d0239f..0aed23b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ(2.60)
-AC_INIT(mpd, 0.16.2, musicpd-dev-team at lists.sourceforge.net)
+AC_INIT(mpd, 0.16.3, musicpd-dev-team at lists.sourceforge.net)
 AC_CONFIG_SRCDIR([src/main.c])
 AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
 AM_CONFIG_HEADER(config.h)
@@ -1081,7 +1081,7 @@ if
 fi
 
 AM_CONDITIONAL(HAVE_OGG_COMMON,
-	  test x$enable_vorbis = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
+	test x$enable_vorbis = xyes || test x$enable_tremor = xyes || test x$enable_oggflac = xyes || test x$enable_flac = xyes)
 
 AM_CONDITIONAL(HAVE_FLAC_COMMON,
 	  test x$enable_flac = xyes || test x$enable_oggflac = xyes)
diff --git a/src/audio_parser.c b/src/audio_parser.c
index ca5182c..139cf1c 100644
--- a/src/audio_parser.c
+++ b/src/audio_parser.c
@@ -192,7 +192,8 @@ audio_format_parse(struct audio_format *dest, const char *src,
 	}
 
 	audio_format_init(dest, rate, sample_format, channels);
-	assert(audio_format_valid(dest));
+	assert(mask ? audio_format_mask_valid(dest)
+	       : audio_format_valid(dest));
 
 	return true;
 }
diff --git a/src/command.c b/src/command.c
index ce0aa97..64f1618 100644
--- a/src/command.c
+++ b/src/command.c
@@ -464,7 +464,7 @@ handle_currentsong(struct client *client,
 		   G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
 {
 	playlist_print_current(client, &g_playlist);
-	return PLAYLIST_RESULT_SUCCESS;
+	return COMMAND_RETURN_OK;
 }
 
 static enum command_return
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index f9d4eb8..6d794db 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -81,6 +81,10 @@ mpd_ffmpeg_log_callback(G_GNUC_UNUSED void *ptr, int level,
 
 #endif /* !OLD_FFMPEG_INCLUDES */
 
+#ifndef AV_VERSION_INT
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#endif
+
 struct mpd_ffmpeg_stream {
 	struct decoder *decoder;
 	struct input_stream *input;
@@ -102,13 +106,11 @@ static int64_t
 mpd_ffmpeg_stream_seek(void *opaque, int64_t pos, int whence)
 {
 	struct mpd_ffmpeg_stream *stream = opaque;
-	bool ret;
 
 	if (whence == AVSEEK_SIZE)
 		return stream->input->size;
 
-	ret = input_stream_seek(stream->input, pos, whence, NULL);
-	if (!ret)
+	if (!input_stream_seek(stream->input, pos, whence, NULL))
 		return -1;
 
 	return stream->input->offset;
@@ -156,7 +158,11 @@ 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 ==
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
+		    AVMEDIA_TYPE_AUDIO)
+#else
 		    CODEC_TYPE_AUDIO)
+#endif
 			return i;
 
 	return -1;
@@ -183,30 +189,40 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
 		   AVCodecContext *codec_context,
 		   const AVRational *time_base)
 {
-	enum decoder_command cmd = DECODE_COMMAND_NONE;
-	uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
-	int16_t *aligned_buffer;
-	size_t buffer_size;
-	int len, audio_size;
-	uint8_t *packet_data;
-	int packet_size;
-
 	if (packet->pts != (int64_t)AV_NOPTS_VALUE)
 		decoder_timestamp(decoder,
 				  av_rescale_q(packet->pts, *time_base,
 					       (AVRational){1, 1}));
 
-	packet_data = packet->data;
-	packet_size = packet->size;
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
+	AVPacket packet2 = *packet;
+#else
+	const uint8_t *packet_data = packet->data;
+	int packet_size = packet->size;
+#endif
 
-	buffer_size = sizeof(audio_buf);
-	aligned_buffer = align16(audio_buf, &buffer_size);
+	uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16];
+	size_t buffer_size = sizeof(audio_buf);
+	int16_t *aligned_buffer = align16(audio_buf, &buffer_size);
 
-	while ((packet_size > 0) && (cmd == DECODE_COMMAND_NONE)) {
-		audio_size = buffer_size;
-		len = avcodec_decode_audio2(codec_context,
-					    aligned_buffer, &audio_size,
-					    packet_data, packet_size);
+	enum decoder_command cmd = DECODE_COMMAND_NONE;
+	while (
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
+	       packet2.size > 0 &&
+#else
+	       packet_size > 0 &&
+#endif
+	       cmd == DECODE_COMMAND_NONE) {
+		int audio_size = buffer_size;
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
+		int len = avcodec_decode_audio3(codec_context,
+						aligned_buffer, &audio_size,
+						&packet2);
+#else
+		int len = avcodec_decode_audio2(codec_context,
+						aligned_buffer, &audio_size,
+						packet_data, packet_size);
+#endif
 
 		if (len < 0) {
 			/* if error, we skip the frame */
@@ -214,8 +230,13 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
 			break;
 		}
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
+		packet2.data += len;
+		packet2.size -= len;
+#else
 		packet_data += len;
 		packet_size -= len;
+#endif
 
 		if (audio_size <= 0)
 			continue;
@@ -230,7 +251,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
 static enum sample_format
 ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context)
 {
-#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51, 41, 0)
 	switch (codec_context->sample_fmt) {
 	case SAMPLE_FMT_S16:
 		return SAMPLE_FORMAT_S16;
@@ -299,12 +320,8 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
 		return;
 	}
 
-	AVFormatContext *format_context;
-	AVCodecContext *codec_context;
-	AVCodec *codec;
-	int audio_stream;
-
 	//ffmpeg works with ours "fileops" helper
+	AVFormatContext *format_context;
 	if (av_open_input_stream(&format_context, stream->io, input->uri,
 				 input_format, NULL) != 0) {
 		g_warning("Open failed\n");
@@ -319,7 +336,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
 		return;
 	}
 
-	audio_stream = ffmpeg_find_audio_stream(format_context);
+	int audio_stream = ffmpeg_find_audio_stream(format_context);
 	if (audio_stream == -1) {
 		g_warning("No audio stream inside\n");
 		av_close_input_stream(format_context);
@@ -327,11 +344,12 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
 		return;
 	}
 
-	codec_context = format_context->streams[audio_stream]->codec;
+	AVCodecContext *codec_context =
+		format_context->streams[audio_stream]->codec;
 	if (codec_context->codec_name[0] != 0)
 		g_debug("codec '%s'", codec_context->codec_name);
 
-	codec = avcodec_find_decoder(codec_context->codec_id);
+	AVCodec *codec = avcodec_find_decoder(codec_context->codec_id);
 
 	if (!codec) {
 		g_warning("Unsupported audio codec\n");
diff --git a/src/decoder/flac_decoder_plugin.c b/src/decoder/flac_decoder_plugin.c
index e89e2ea..9d980b7 100644
--- a/src/decoder/flac_decoder_plugin.c
+++ b/src/decoder/flac_decoder_plugin.c
@@ -81,7 +81,7 @@ flac_tell_cb(G_GNUC_UNUSED const FLAC__StreamDecoder *fd,
 	struct flac_data *data = (struct flac_data *) fdata;
 
 	if (!data->input_stream->seekable)
-		return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
+		return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
 
 	*offset = (long)(data->input_stream->offset);
 
diff --git a/src/directory.h b/src/directory.h
index 69e2b36..151cf54 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -62,7 +62,8 @@ directory_free(struct directory *directory);
 static inline bool
 directory_is_empty(const struct directory *directory)
 {
-	return directory->children.nr == 0 && directory->songs.nr == 0;
+	return directory->children.nr == 0 && directory->songs.nr == 0 &&
+		playlist_vector_is_empty(&directory->playlists);
 }
 
 static inline const char *
diff --git a/src/playlist_song.c b/src/playlist_song.c
index 1e8e987..1a543a0 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -105,6 +105,13 @@ playlist_check_translate_song(struct song *song, const char *base_uri)
 		}
 	}
 
+	if (base_uri != NULL && strcmp(base_uri, ".") == 0)
+		/* g_path_get_dirname() returns "." when there is no
+		   directory name in the given path; clear that now,
+		   because it would break the database lookup
+		   functions */
+		base_uri = NULL;
+
 	if (g_path_is_absolute(uri)) {
 		/* XXX fs_charset vs utf8? */
 		char *prefix = base_uri != NULL
@@ -129,7 +136,7 @@ playlist_check_translate_song(struct song *song, const char *base_uri)
 	else
 		uri = g_strdup(uri);
 
-	if (uri_has_scheme(base_uri)) {
+	if (uri_has_scheme(uri)) {
 		dest = song_remote_new(uri);
 		g_free(uri);
 	} else {
diff --git a/src/playlist_vector.h b/src/playlist_vector.h
index 566de5f..62861ae 100644
--- a/src/playlist_vector.h
+++ b/src/playlist_vector.h
@@ -51,6 +51,12 @@ playlist_vector_init(struct playlist_vector *pv)
 void
 playlist_vector_deinit(struct playlist_vector *pv);
 
+static inline bool
+playlist_vector_is_empty(const struct playlist_vector *pv)
+{
+	return pv->head == NULL;
+}
+
 struct playlist_metadata *
 playlist_vector_find(struct playlist_vector *pv, const char *name);
 

-- 
Git repository for pkg-mpd



More information about the Pkg-mpd-commits mailing list