Permalink
Browse files

Disable reading TLEN frames in ID3 tags. These are too often wrong an…

…d lame is known to write bad values due to an unresolved bug, the only way to be sure is to check for ourselves.
  • Loading branch information...
1 parent cfdd72e commit 4e53b2349552a3beeab7a282fed85848195f7d87 @stuartm stuartm committed Jan 21, 2011
Showing with 8 additions and 16 deletions.
  1. +8 −16 mythplugins/mythmusic/mythmusic/metaioid3.cpp
@@ -214,12 +214,9 @@ Metadata *MetaIOID3::read(QString filename)
== TStringToQString(musicbrainz->fieldList().front()));
}
- // Length
- if (!tag->frameListMap()["TLEN"].isEmpty())
- {
- int length = tag->frameListMap()["TLEN"].front()->toString().toInt();
- metadata->setLength(length);
- }
+ // TLEN - Ignored intentionally, some encoders write bad values
+ // e.g. Lame under certain circumstances will always write a length of
+ // 27 hours
// Album Art
if (!tag->frameListMap()["APIC"].isEmpty())
@@ -231,16 +228,11 @@ Metadata *MetaIOID3::read(QString filename)
metadata->setCompilation(compilation);
- if (metadata->Length() <= 0)
- {
- TagLib::FileRef *fileref = new TagLib::FileRef(mpegfile);
- metadata->setLength(getTrackLength(fileref));
- // FileRef takes ownership of mpegfile, and is responsible for it's
- // deletion. Messy.
- delete fileref;
- }
- else
- delete mpegfile;
+ TagLib::FileRef *fileref = new TagLib::FileRef(mpegfile);
+ metadata->setLength(getTrackLength(fileref));
+ // FileRef takes ownership of mpegfile, and is responsible for it's
+ // deletion. Messy.
+ delete fileref;
return metadata;
}

0 comments on commit 4e53b23

Please sign in to comment.