[mythtv] [patch] fix doubled genres in mythmusic

myth at fsck.ch myth at fsck.ch
Mon Dec 29 06:04:20 EST 2003


Hi

A very small patch to fix the following in Mythmusic:

When an mp3 with both id3v1 and id3v2 tags is scanned for DB insertion,
libid3tag returns both genre fields. Mythmusic then concats these fields,
which results in doubled genres such as 'BluesBlues'. I was told the
concatenation is needed sometimes, so this patch does not remove this
behaviour, it just checks for doubled genre fields and avoids them.

It also removes a doubled #include.


cheers, t.
-------------- next part --------------
--- mythmusic.orig/maddecoder.cpp	2003-12-29 11:27:58.000000000 +0000
+++ mythmusic/maddecoder.cpp	2003-12-29 11:29:38.000000000 +0000
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <iostream>
 #include <math.h>
-#include <stdio.h>
 #include <qregexp.h>
 #include <sys/stat.h>
 using namespace std;
@@ -615,7 +614,8 @@
                                 year = atoi((char *)latin1); break;
                     case 4: if (tracknum == 0) 
                                 tracknum = atoi((char *)latin1); break;
-                    case 5: genre += (char *)latin1; break;
+                    case 5: if (strcmp(genre, (char *)latin1))
+                                genre += (char *)latin1; break;
                     default: break;
                 }
 


More information about the mythtv-dev mailing list