From 0dcd865c2e33b3087f630b9aea992103c5d1caef Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sun, 21 Mar 2010 17:25:18 -0700 Subject: [PATCH 1/6] Modify version string to post-release version 0.15.10~git --- NEWS | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 96b6709c6..70179b14d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +ver 0.15.10 (2010/??/??) + + ver 0.15.9 (2010/03/21) * decoders: - mad: fix crash when seeking at end of song diff --git a/configure.ac b/configure.ac index 4bbed4549..924b12568 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.15.9, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.15.10~git, 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) From a1a03deed278a865bdc7d3394cda838543c8b03c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Apr 2010 07:51:29 +0200 Subject: [PATCH 2/6] decoder/mad: properly calculate ID3 size without libid3tag Without libid3tag, we were trying to skip the ID3 frame (since 0.15.2). Its length however was not calculated at all, we were just dropping everything from the current input buffer. This lead to the first few seconds of the file being skipped. This patch attempts to calculate the ID3v2 frame size with the formula from: http://www.id3.org/id3v2.4.0-structure 3.1 and 6.2 --- NEWS | 2 ++ src/decoder/mad_plugin.c | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 70179b14d..b69bd18f1 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.15.10 (2010/??/??) +* decoders: + - mad: properly calculate ID3 size without libid3tag ver 0.15.9 (2010/03/21) diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index 7cc78a0d2..1bda418e0 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -425,7 +425,27 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize, /* This code is enabled when libid3tag is disabled. Instead of parsing the ID3 frame, it just skips it. */ - mad_stream_skip(&data->stream, tagsize); + size_t count = data->stream.bufend - data->stream.this_frame; + + if (tagsize <= count) { + mad_stream_skip(&data->stream, tagsize); + } else { + mad_stream_skip(&data->stream, count); + + while (count < tagsize) { + size_t len = tagsize - count; + if (len > sizeof(buffer)) + len = sizeof(buffer); + + char ignored[1024]; + len = decoder_read(data->decoder, data->input_stream, + ignored, len); + if (len == 0) + break; + else + count += len; + } + } #endif } @@ -433,16 +453,16 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize, /** * This function emulates libid3tag when it is disabled. Instead of * doing a real analyzation of the frame, it just checks whether the - * frame begins with the string "ID3". If so, it returns the full - * length. + * frame begins with the string "ID3". If so, it returns the length + * of the ID3 frame. */ static signed long id3_tag_query(const void *p0, size_t length) { const char *p = p0; - return length > 3 && memcmp(p, "ID3", 3) == 0 - ? length + return length >= 10 && memcmp(p, "ID3", 3) == 0 + ? (p[8] << 7) + p[9] + 10 : 0; } #endif /* !HAVE_ID3TAG */ From e98bd55cbf850f17fa3b7339c659791834e9aaa8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 May 2010 20:57:57 +0200 Subject: [PATCH 3/6] input/mms: fix memory leak in error handler --- NEWS | 2 ++ src/input/mms_input_plugin.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index b69bd18f1..ab0aa2109 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.15.10 (2010/??/??) +* input: + - mms: fix memory leak in error handler * decoders: - mad: properly calculate ID3 size without libid3tag diff --git a/src/input/mms_input_plugin.c b/src/input/mms_input_plugin.c index 2a3c53776..eb3a5cedb 100644 --- a/src/input/mms_input_plugin.c +++ b/src/input/mms_input_plugin.c @@ -49,6 +49,7 @@ input_mms_open(struct input_stream *is, const char *url) m = g_new(struct input_mms, 1); m->mms = mmsx_connect(NULL, NULL, url, 128 * 1024); if (m->mms == NULL) { + g_free(m); g_warning("mmsx_connect() failed"); return false; } From 28736414a8b1ae4878d4d18f042a9c04ef7dd6c5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 May 2010 21:11:00 +0200 Subject: [PATCH 4/6] input/mms: initialize the "eof" attribute --- NEWS | 1 + src/input/mms_input_plugin.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index ab0aa2109..d2baa737e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.15.10 (2010/??/??) * input: - mms: fix memory leak in error handler + - mms: initialize the "eof" attribute * decoders: - mad: properly calculate ID3 size without libid3tag diff --git a/src/input/mms_input_plugin.c b/src/input/mms_input_plugin.c index eb3a5cedb..25e3129d9 100644 --- a/src/input/mms_input_plugin.c +++ b/src/input/mms_input_plugin.c @@ -54,6 +54,8 @@ input_mms_open(struct input_stream *is, const char *url) return false; } + m->eof = false; + /* XX is this correct? at least this selects the ffmpeg decoder, which seems to work fine*/ is->mime = g_strdup("audio/x-ms-wma"); From 442d2e74e359e44ed42d67341229df0d9010a04c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 30 May 2010 17:27:03 +0200 Subject: [PATCH 5/6] decoder/mad: fix buffer variable name on !HAVE_ID3TAG --- src/decoder/mad_plugin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/decoder/mad_plugin.c b/src/decoder/mad_plugin.c index 1bda418e0..ee07ae5a4 100644 --- a/src/decoder/mad_plugin.c +++ b/src/decoder/mad_plugin.c @@ -434,10 +434,10 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize, while (count < tagsize) { size_t len = tagsize - count; - if (len > sizeof(buffer)) - len = sizeof(buffer); - char ignored[1024]; + if (len > sizeof(ignored)) + len = sizeof(ignored); + len = decoder_read(data->decoder, data->input_stream, ignored, len); if (len == 0) From 57e95ea6f425e03d3d1586e02dae6a0974b00f28 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sun, 30 May 2010 08:59:00 -0700 Subject: [PATCH 6/6] mpd version 0.15.10 --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d2baa737e..ca4e7ecc4 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.15.10 (2010/??/??) +ver 0.15.10 (2010/05/30) * input: - mms: fix memory leak in error handler - mms: initialize the "eof" attribute diff --git a/configure.ac b/configure.ac index 924b12568..fbe1de92f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.15.10~git, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.15.10, 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)