diff options
Diffstat (limited to 'apps/metadata.c')
-rw-r--r-- | apps/metadata.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index 1563466eda..8838a83aa4 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -1260,9 +1260,24 @@ static bool get_musepack_metadata(int fd, struct mp3entry *id3) | |||
1260 | "%d.%d dB", album_gain/100, abs(album_gain)%100); | 1260 | "%d.%d dB", album_gain/100, abs(album_gain)%100); |
1261 | } | 1261 | } |
1262 | } else { | 1262 | } else { |
1263 | /* There's no certain way to detect these pre-sv7 streams, apparently */ | 1263 | header[0] = letoh32(header[0]); |
1264 | /* TODO: add sv6 parsing here */ | 1264 | unsigned int streamversion = (header[0] >> 11) & 0x03FF; |
1265 | return false; | 1265 | if (streamversion != 4 && streamversion != 5 && streamversion != 6) |
1266 | return false; | ||
1267 | id3->frequency = 44100; | ||
1268 | id3->track_gain = 0; | ||
1269 | id3->track_peak = 0; | ||
1270 | id3->album_gain = 0; | ||
1271 | id3->album_peak = 0; | ||
1272 | |||
1273 | if (streamversion >= 5) | ||
1274 | samples = (uint64_t)header[1]*1152; // 32 bit | ||
1275 | else | ||
1276 | samples = (uint64_t)(header[1] >> 16)*1152; // 16 bit | ||
1277 | |||
1278 | samples -= 576; | ||
1279 | if (streamversion < 6) | ||
1280 | samples -= 1152; | ||
1266 | } | 1281 | } |
1267 | 1282 | ||
1268 | id3->vbr = true; | 1283 | id3->vbr = true; |