diff options
Diffstat (limited to 'lib/rbcodec/metadata/tta.c')
-rw-r--r-- | lib/rbcodec/metadata/tta.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbcodec/metadata/tta.c b/lib/rbcodec/metadata/tta.c index 5f99c4776e..a481d8dd21 100644 --- a/lib/rbcodec/metadata/tta.c +++ b/lib/rbcodec/metadata/tta.c | |||
@@ -93,21 +93,21 @@ bool get_tta_metadata(int fd, struct mp3entry* id3) | |||
93 | 93 | ||
94 | /* skip check CRC */ | 94 | /* skip check CRC */ |
95 | 95 | ||
96 | id3->channels = (GET_HEADER(ttahdr, NUM_CHANNELS)); | 96 | unsigned short channels = (GET_HEADER(ttahdr, NUM_CHANNELS)); |
97 | id3->frequency = (GET_HEADER(ttahdr, SAMPLE_RATE)); | 97 | id3->frequency = (GET_HEADER(ttahdr, SAMPLE_RATE)); |
98 | id3->length = ((GET_HEADER(ttahdr, DATA_LENGTH)) / id3->frequency) * 1000LL; | 98 | id3->length = ((GET_HEADER(ttahdr, DATA_LENGTH)) / id3->frequency) * 1000LL; |
99 | bps = (GET_HEADER(ttahdr, BITS_PER_SAMPLE)); | 99 | bps = (GET_HEADER(ttahdr, BITS_PER_SAMPLE)); |
100 | 100 | ||
101 | datasize = id3->filesize - id3->first_frame_offset; | 101 | datasize = id3->filesize - id3->first_frame_offset; |
102 | origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * id3->channels; | 102 | origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * channels; |
103 | 103 | ||
104 | id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * id3->channels * bps | 104 | id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * channels * bps |
105 | / (origsize * 1000LL)); | 105 | / (origsize * 1000LL)); |
106 | 106 | ||
107 | /* output header info (for debug) */ | 107 | /* output header info (for debug) */ |
108 | DEBUGF("TTA header info ----\n"); | 108 | DEBUGF("TTA header info ----\n"); |
109 | DEBUGF("id: %x\n", (unsigned int)(GET_HEADER(ttahdr, ID))); | 109 | DEBUGF("id: %x\n", (unsigned int)(GET_HEADER(ttahdr, ID))); |
110 | DEBUGF("channels: %d\n", id3->channels); | 110 | DEBUGF("channels: %d\n", channels); |
111 | DEBUGF("frequency: %ld\n", id3->frequency); | 111 | DEBUGF("frequency: %ld\n", id3->frequency); |
112 | DEBUGF("length: %ld\n", id3->length); | 112 | DEBUGF("length: %ld\n", id3->length); |
113 | DEBUGF("bitrate: %d\n", id3->bitrate); | 113 | DEBUGF("bitrate: %d\n", id3->bitrate); |