Date: | Thu, 13 Feb 2003 17:03:06 -0500 |
To: | bug-mp3-info [...] rt.cpan.org |
From: | Chris Nandor <cnandor [...] cpan.org> |
Subject: | bug reading id3v2 fields ending in null |
From SF.net:
Some encoders (EAC - www.exactaudiocopy.de) write to
the id3v2 fields with null-terminated strings. I've
noticed that mp3s with such fields appear with no data
fields when read as
$tag = get_mp3tag($file)
but successfully retrieve the id3v1s when read as
$tag = get_mp3tag($file, 1)
I've never used perl before (having learned all I know
today pickin through globecom jukebox
(www.globecom.se)'s addmp3id3.pl, so it may be that
data is being returned, but addmp3id3 isn't dealing
with it right. I got these mp3s to read by changing
read $fh, my($bytes), $size - $hlen;
if (exists $h->{$id}) {
to
read $fh, my($bytes), $size - $hlen;
if (( (length ($bytes)) > 1 ) &&(substr
($bytes, -1, 1) eq "\x00" ))
{chop ($bytes);}
if (exists $h->{$id}) {
around line 487.
I suspect there's probably a much more elegent solution
though...