mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2008
Posts: 93
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
Evenin folks!

I just happened to update to 6.31, and read thru versions.txt to see what changed. What caught my attention was this (mIRC 6.3 Changes):
Quote:
86.Fixed $mp3() not handling unicode tags correctly.


Of couse, I immediately tried that, as I wrote an Email to Khaled back in 6.2x days about incorrect handling of Unicode. Unfortunately, it still doesnt work:
Code:
//echo $sound(E:\Nuclear Blast Allstars\Out of the Dark\02 - Nuclear Blast Allstars - Schizo (feat. Peter Tagtgren).mp3,TPE2).tag
\x01\xFF\xFEN u c l e a r B l a s t A l l s t a r s

That \x01 tells me that you may be parsing the ID3v2 structure incorrectly. Following the ID3v2 Header (containing size, flags and the frame id), there is either \x00 (for ASCII content) or \x01 (for Unicode content), \x01 ofc followed by the Unicode BOM \xFF\xFE (altho the BOM is not required there, most MP3 encoders include it).
I'm still using my own DLL to extract Unicode from ID3v2, at least as fallback when $sound returns something that starts with \x01 or \xFF\xFE.

Looking forward to a fix in the future!

Greetings, BhaaL

Joined: Dec 2002
Posts: 5,421
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,421
I tested this change with a unicode headered mp3 and it seems to work fine. Can you provide a link to a unicode headered mp3 that reproduces this issue? Thanks.

Update: I found a way to reproduce this, the unicode handling was fixed for some parts of the mp3 header but not for tags. This should be fixed for the next version.

Last edited by Khaled; 12/04/08 11:04 AM.
Joined: Mar 2008
Posts: 93
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
Originally Posted By: Khaled
Update: I found a way to reproduce this, the unicode handling was fixed for some parts of the mp3 header but not for tags. This should be fixed for the next version.


Thats great news!

But...I just found another issue related to ID3 handling.
Check out this example MP3, cut down from Disarmonia Mundi - Shattered Lives and Broken Dreams.
Ripped it years ago from CD using MMJB, which seems to write a fairly large tag called GEOB.

Testing it out with mIRC, $mp3(test.mp3,0).tag only returns nothing. Using good old $mp3(test.mp3).title, nothing happens either.
Looking at the file in a hex editor (or using my own DLL), it shows other information such as TPE2, TRCK, TALB and TIT1 too.
Also, trying to access one of the tags (TPE2 for example, $mp3(test.mp3,%index_of_TPE2).tag), mIRC hangs for a second or two, and returns nothing at all. At least the real file does, the larger the file, the longer it takes - test.mp3 is cut down to a second, so it doesnt really take that long.

But...the file plays without any cracks or anything. Only Tag-reading seems affected.

I suppose there is either another flaw in reading the ID3v2 header and/or the frames; or the ID3v1 reading is bugged somewhere aswell (using .title etc doesn't return anything either!)

FYI:
Quote:
The ID3v2 tag size is stored as a 32 bit synchsafe integer (section 6.2), making a total of 28 effective bits (representing up to 256MB).

(from the ID3v2 Spec at http://www.id3.org/id3v2.4.0-structure)

My DLL uses this to get the right tag length:
Code:
unsigned int ConvertID3v2HeaderSize(unsigned int in) {
   unsigned char *input = (unsigned char*)∈
   return (input[0] & 0x7f) | ((input[1] & 0x7f) << 7) | ((input[2] && 0x7f) << 14) | ((input[3] && 0x7f)<< 21);
}

Note this only applies to the ID3v2 header itself, not to frame headers.

I suppose you may be missing that, you are missing some delimiting char (possibly a buffer overflow?) or either got some other offset-related thing wrong.


I hope I could help with that mp3 file, hoping to get it fixed soon smile

Greetings, BhaaL

Joined: Dec 2002
Posts: 5,421
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,421
Thanks appreciate the information, I've resolved the the issue with this mp3 along with various other mp3s I have here - so it should hopefully work a-ok in the next version.

Joined: Mar 2008
Posts: 93
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
Originally Posted By: Khaled
Thanks appreciate the information, I've resolved the the issue with this mp3 along with various other mp3s I have here - so it should hopefully work a-ok in the next version.


Great, looking forward to it!

Greetings, BhaaL


Link Copied to Clipboard