| | 137 | |
| | 138 | // if there is no ID3v2 tag, try to read the ID3v1 tag and copy it to the ID3v2 tag structure |
| | 139 | if (tag->isEmpty()) |
| | 140 | { |
| | 141 | TagLib::ID3v1::Tag *tag_v1 = mpegfile->ID3v1Tag(); |
| | 142 | |
| | 143 | if (!tag_v1) |
| | 144 | { |
| | 145 | delete mpegfile; |
| | 146 | return NULL; |
| | 147 | } |
| | 148 | |
| | 149 | if (!tag_v1->isEmpty()) |
| | 150 | { |
| | 151 | tag->setTitle(tag_v1->title()); |
| | 152 | tag->setArtist(tag_v1->artist()); |
| | 153 | tag->setAlbum(tag_v1->album()); |
| | 154 | tag->setTrack(tag_v1->track()); |
| | 155 | tag->setYear(tag_v1->year()); |
| | 156 | tag->setGenre(tag_v1->genre()); |
| | 157 | } |
| | 158 | } |