GNOME Bugzilla – Bug 773443
Genre in ID3v1 tag is always set to "Other" when option "Use text-only genre in ID3v2 tags" is disabled
Last modified: 2016-11-07 22:47:04 UTC
I stumbled upon an issue related to writing ID3v1 tags. When the option "Use text-only genre in ID3v2 tags" is disabled, the genre in ID3v1 (yes, v1!) becomes "Other", no matter which genre was set. Please look at the ID3v1 tag of the test file I tagged with EasyTAG 2.4.2 ("Use text-only genre in ID3v2 tags" was disabled): $ tail -c 128 test.mp3 | hexdump -C 00000000 54 41 47 54 68 69 73 20 69 73 20 74 68 65 20 74 |TAGThis is the t| 00000010 69 74 6c 65 20 66 69 65 6c 64 23 23 23 23 23 23 |itle field######| 00000020 23 54 68 69 73 20 69 73 20 74 68 65 20 61 72 74 |#This is the art| 00000030 69 73 74 20 66 69 65 6c 64 23 23 23 23 23 23 54 |ist field######T| 00000040 68 69 73 20 69 73 20 74 68 65 20 61 6c 62 75 6d |his is the album| 00000050 20 66 69 65 6c 64 23 23 23 23 23 23 23 32 30 31 | field#######201| 00000060 36 54 68 69 73 20 69 73 20 74 68 65 20 63 6f 6d |6This is the com| 00000070 6d 65 6e 74 20 66 69 65 6c 64 23 23 23 00 63 0c |ment field###.c.| 00000080 The text fields are padded with # signs on purpose. Notice the last three bytes: 00 63 0c. 00 is the separator byte, 63 is the track number (=99 dec, which is correct), and 0c is the genre ID (=12 dec, which corresponds to "Other"). This is wrong, in this test the track was tagged as "Metal", so the ID should be 09 hex. When I enable "Use text-only genre in ID3v2 tags" and tag the file again, the last three bytes become 00 63 09. The genre ID is now correct. As far as I see, the genre in ID3v2 tag is written correctly both as a number, and as text (I viewed the contents of ID3v2 tag using MP3Diags program). In my tests the unexpected behavior only concerns ID3v1 tag.
Created attachment 338369 [details] Test mp3 file with wrong genre ID in ID3v1 tag. Few seconds of silence tagged with ID3v1 and ID3v2.4 tags.
Created attachment 339192 [details] [review] patch for ID3v2.4 genre saving Apologies for not replying sooner - I was travelling for a while. Does this only occur when using ID3v2.4, or does it also occur with ID3v2.3? If it is just with 2.4, the attached patch (untested) should fix the problem. I will have a closer look over the next few days.
Hi David, thanks for looking into this. I ran some further tests, as you requested. Without your patch: the problem occurs when ID3v2.4 is used, but not with ID3v2.3. So it seems you were right. After applying your patch: the genre in ID3v1 tag is stored correctly, no matter which ID3v2.x version is set.
Great to hear, and thanks for testing the patch! I pushed it to master as commit acc9db6ed544a2bb1b66d955adadfccbca3ae092.