Discussion:
[PATCH 1/2] id3: allow comments with description "description"
Johannes Weißl
2011-07-28 15:19:03 UTC
Permalink
MusicBrainz Picard writes them this way...
---
id3.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/id3.c b/id3.c
index d296913..cdcff6b 100644
--- a/id3.c
+++ b/id3.c
@@ -787,8 +787,8 @@ static void decode_txxx(struct id3tag *id3, const char *buf, int len, int encodi
static void decode_comment(struct id3tag *id3, const char *buf, int len, int encoding)
{
int slen;
- char out0;
char *out;
+ int valid_description;

if (len <= 3)
return;
@@ -802,11 +802,10 @@ static void decode_comment(struct id3tag *id3, const char *buf, int len, int enc
if (!out)
return;

- out0 = *out;
+ valid_description = strcmp(out, "") || strcmp(out, "description");
free(out);

- /* we are interested only in comments with empty description */
- if (out0 != '\0')
+ if (!valid_description)
return;

slen = id3_skiplen(buf, len, encoding);
--
1.7.6
Loading...