Subject: | Reading ID3v2.4 Frames with Data Length Flag |
I purchased some mp3s from Amazon which appeared to have 2.4 features
not yet supported in MP3::Tag. Several frames have the
"Unsynchronization" and "Data length indicator" flags set, which caused
the frame size to be wrong and the frame data to be read incorrectly. I
attached a sample file with just the tag data (written from ->as_bin_raw).
Here's what I had to do to get it to read correctly. I haven't tried to
write the tags back out.
File MP3/Tag/ID3v2.pm
(line 234) - Changed to this:
my $frameFlags = $self->check_flags($flags);
if ($frameFlags->{data_length})
{
my($newSize) = unpack('a4', substr($self->{tag_data}, $pos +
$headersize, 4));
$size = 4 + un_syncsafe_4bytes $newSize;
}
$self->{frames}->{$ID} = {flags=>$frameFlags,
major=>$major,
data=>substr($self->{tag_data}, $pos + $headersize, $size)};
##########################################
(line 361) - Added this:
if ($frame->{flags}->{data_length})
{
$result = substr($result, 4);
}
##########################################
Not sure if this module is still supported, but if anyone else runs into
this problem, this should help.
Subject: | just_tag.mp3 |
Message body not shown because it is not plain text.