? gst/id3demux/TODO
? gst/id3demux/id3v2.3.0.txt
Index: gst/id3demux/id3v2frames.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/id3demux/id3v2frames.c,v
retrieving revision 1.15
diff -u -r1.15 id3v2frames.c
--- gst/id3demux/id3v2frames.c	28 Apr 2006 11:37:22 -0000	1.15
+++ gst/id3demux/id3v2frames.c	10 May 2006 11:58:47 -0000
@@ -622,8 +622,17 @@
         gint pos;
         gboolean found = FALSE;
 
-        /* Double parenthesis ends the numeric genres */
-        if (tag_str[0] == '(' && tag_str[1] == '(')
+        /* Double parenthesis ends the numeric genres, but swallow
+         * the first one */
+        if (tag_str[0] == '(' && tag_str[1] == '(') {
+          tag_str++;
+          len--;
+          break;
+        }
+
+        /* If the first char is not a parenthesis, then stop
+         * looking for parenthesised genre strings */
+        if (tag_str[0] != '(')
           break;
 
         for (pos = 1; pos < len; pos++) {
@@ -640,6 +649,12 @@
             found = TRUE;
             break;
           }
+
+          /* If we encounter a non-digit while searching for a closing 
+           * parenthesis, we should not try and interpret this as a 
+           * numeric genre string */
+          if (!g_ascii_isdigit (tag_str[pos]))
+            break;
         }
         if (!found)
           break;                /* There was no closing parenthesis */
