From 803a698f988a0f96ef116dd8d47d3c0288a6d3cb Mon Sep 17 00:00:00 2001 From: Patrik Weiskircher Date: Sun, 20 Sep 2009 23:28:07 +0200 Subject: [PATCH 1/6] output/osx: fix the OS X 10.6 build Include CoreServices/CoreServices.h. --- NEWS | 2 ++ src/output/osx_plugin.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 47da1a03f..b6b23942f 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.15.4 (2009/??/??) * decoders: - vorbis: revert "faster tag scanning with ov_test_callback()" +* output: + - osx: fix the OS X 10.6 build ver 0.15.3 (2009/08/29) diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index 24db1f5b7..04173bf79 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -21,6 +21,7 @@ #include #include +#include #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "osx" From 82c6c137808264cc84220274f8ab57e8c47d7772 Mon Sep 17 00:00:00 2001 From: Serge Ziryukin Date: Sun, 20 Sep 2009 14:16:41 +0300 Subject: [PATCH 2/6] input/mms: fix G_LOG_DOMAIN value --- src/input/mms_input_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/mms_input_plugin.c b/src/input/mms_input_plugin.c index 82162a5cc..2a3c53776 100644 --- a/src/input/mms_input_plugin.c +++ b/src/input/mms_input_plugin.c @@ -27,7 +27,7 @@ #include #undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "jack" +#define G_LOG_DOMAIN "input_mms" struct input_mms { mmsx_t *mms; From efb290073bfecfb051a9839ec30fb5c57524640d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 15:22:36 +0200 Subject: [PATCH 3/6] decoder_buffer: added function decoder_buffer_skip() --- src/decoder_buffer.c | 26 ++++++++++++++++++++++++++ src/decoder_buffer.h | 10 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/decoder_buffer.c b/src/decoder_buffer.c index 76e9126ef..b6fa90004 100644 --- a/src/decoder_buffer.c +++ b/src/decoder_buffer.c @@ -138,3 +138,29 @@ decoder_buffer_consume(struct decoder_buffer *buffer, size_t nbytes) assert(buffer->consumed <= buffer->length); } + +bool +decoder_buffer_skip(struct decoder_buffer *buffer, size_t nbytes) +{ + size_t length; + const void *data; + bool success; + + /* this could probably be optimized by seeking */ + + while (true) { + data = decoder_buffer_read(buffer, &length); + if (data != NULL) { + if (length > nbytes) + length = nbytes; + decoder_buffer_consume(buffer, length); + nbytes -= length; + if (nbytes == 0) + return true; + } + + success = decoder_buffer_fill(buffer); + if (!success) + return false; + } +} diff --git a/src/decoder_buffer.h b/src/decoder_buffer.h index d951a4055..411e3bd88 100644 --- a/src/decoder_buffer.h +++ b/src/decoder_buffer.h @@ -93,4 +93,14 @@ decoder_buffer_read(const struct decoder_buffer *buffer, size_t *length_r); void decoder_buffer_consume(struct decoder_buffer *buffer, size_t nbytes); +/** + * Skips the specified number of bytes, discarding its data. + * + * @param buffer the decoder_buffer object + * @param nbytes the number of bytes to skip + * @return true on success, false on error + */ +bool +decoder_buffer_skip(struct decoder_buffer *buffer, size_t nbytes); + #endif From b0f9a1454af5af826255e988d1ca8fe78df2c136 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 15:22:47 +0200 Subject: [PATCH 4/6] decoder/faad: skip assertion failure on large ID3 tags When the ID3 tag in an AAC file is larger than the current buffer, the function decoder_buffer_consume() aborts. By using the new function decoder_buffer_skip() instead, we can safely skip the ID3 tag. --- NEWS | 1 + src/decoder/faad_plugin.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index b6b23942f..ecb576dde 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.15.4 (2009/??/??) * decoders: - vorbis: revert "faster tag scanning with ov_test_callback()" + - faad: skip assertion failure on large ID3 tags * output: - osx: fix the OS X 10.6 build diff --git a/src/decoder/faad_plugin.c b/src/decoder/faad_plugin.c index d0537dd5b..7b2806a4c 100644 --- a/src/decoder/faad_plugin.c +++ b/src/decoder/faad_plugin.c @@ -162,6 +162,7 @@ faad_song_duration(struct decoder_buffer *buffer, struct input_stream *is) size_t tagsize; const unsigned char *data; size_t length; + bool success; fileread = is->size >= 0 ? is->size : 0; @@ -179,8 +180,11 @@ faad_song_duration(struct decoder_buffer *buffer, struct input_stream *is) tagsize += 10; - decoder_buffer_consume(buffer, tagsize); - decoder_buffer_fill(buffer); + success = decoder_buffer_skip(buffer, tagsize) && + decoder_buffer_fill(buffer); + if (!success) + return -1; + data = decoder_buffer_read(buffer, &length); if (data == NULL) return -1; From 65693d057bd57a8df3f491650485087365170564 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Sep 2009 15:41:43 +0200 Subject: [PATCH 5/6] decoder/ffmpeg: use the "artist" tag if "author" is not present Usually, we read our "artist" tag from ffmpeg's "author" tag. In some cases however (e.g. APE), this tag is named "artist". This patch implements a fallback: if no "author" is found, MPD tries to use "artist". --- NEWS | 1 + src/decoder/ffmpeg_plugin.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ecb576dde..29f8b9246 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.15.4 (2009/??/??) * decoders: - vorbis: revert "faster tag scanning with ov_test_callback()" - faad: skip assertion failure on large ID3 tags + - ffmpeg: use the "artist" tag if "author" is not present * output: - osx: fix the OS X 10.6 build diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index abccdf977..27b0c2507 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -338,13 +338,14 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input) } #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) -static void +static bool ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m, enum tag_type type, const char *name) { AVMetadataTag *mt = av_metadata_get(m, name, NULL, 0); if (mt != NULL) tag_add_item(tag, type, mt->value); + return mt != NULL; } #endif @@ -359,7 +360,9 @@ static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx) #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title"); - ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author"); + if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author")) + ffmpeg_copy_metadata(tag, f->metadata, + TAG_ITEM_ARTIST, "artist"); ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album"); ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment"); ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre"); From 325e380b8e44fd07a3e477e8fcfed9e6e1c80e7f Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 3 Oct 2009 05:44:26 -0700 Subject: [PATCH 6/6] mpd version 0.15.4 --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 29f8b9246..435a4720e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.15.4 (2009/??/??) +ver 0.15.4 (2009/10/03) * decoders: - vorbis: revert "faster tag scanning with ov_test_callback()" - faad: skip assertion failure on large ID3 tags diff --git a/configure.ac b/configure.ac index 822bf10a2..5f07ddd7c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.15.4~git, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.15.4, musicpd-dev-team@lists.sourceforge.net) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2]) AM_CONFIG_HEADER(config.h)