- edited description
Problem with deprecated frames in ID3 tag conversion
Issue #242
resolved
I'm forcing the conversion of ID3 tags from ID3v2.3 to ID3v2.4 and viceversa, but sometimes it isn't able to complete the conversion fired with:
[AudioFile].getTagAndConvertOrCreateAndSetDefault()
This is the stacktrace:
java.lang.ClassCastException: org.jaudiotagger.tag.id3.framebody.FrameBodyDeprecated cannot be cast to
org.jaudiotagger.tag.id3.framebody.FrameBodyUnsupported at
org.jaudiotagger.tag.id3.ID3v24Frame.createV24FrameFromV23Frame(SourceFile:199) at
org.jaudiotagger.tag.id3.ID3v24Frame.<init>(SourceFile:255) at
org.jaudiotagger.tag.id3.ID3v24Tag.convertFrame(SourceFile:423) at
org.jaudiotagger.tag.id3.ID3v24Tag.addFrame(SourceFile:361) at
org.jaudiotagger.tag.id3.AbstractID3v2Tag.copyFrames(SourceFile:262) at
org.jaudiotagger.tag.id3.ID3v24Tag.<init>(SourceFile:530) at
org.jaudiotagger.audio.mp3.MP3File.setID3v2Tag(SourceFile:811) at
org.jaudiotagger.audio.mp3.MP3File.setTag(SourceFile:1138) at
org.jaudiotagger.audio.mp3.MP3File.getTagAndConvertOrCreateAndSetDefault(SourceFile:1199)
Inside the ID3v24Frame.java, is casting the frame to FrameBodyUnsupported. Shouldn't be added something like that?
// Unknown Frame e.g NCON or TDRL (because TDRL unknown to V23)
else
{
if(frame.getBody() instanceof FrameBodyUnsupported) {
this.frameBody = new FrameBodyUnsupported((FrameBodyUnsupported) frame.getBody());
this.frameBody.setHeader(this);
identifier = frame.getIdentifier();
logger.finer("V3:Unknown:Orig id is:" + frame.getIdentifier() + ":New id is:" + identifier);
} else if(frame.getBody() instanceof FrameBodyDeprecated) {
this.frameBody = new FrameBodyDeprecated((FrameBodyDeprecated) frame.getBody());
this.frameBody.setHeader(this);
identifier = frame.getIdentifier();
logger.finer("V3:Deprecated:Orig id is:" + frame.getIdentifier() + ":New id is:" + identifier);
}
}
Comments (2)
-
reporter -
repo owner - changed status to resolved
Yes I think you are right, I have implemented your fix.
- Log in to comment