summaryrefslogtreecommitdiff
path: root/lib/rbcodec/metadata/tta.c
diff options
context:
space:
mode:
authorRoman Artiukhin <bahusdrive@gmail.com>2024-01-24 12:28:27 +0200
committerSolomon Peachy <pizza@shaftnet.org>2024-02-02 09:36:53 -0500
commit76ec55cc49e306a54ac7e43acf8a7f70ba7905a0 (patch)
treee151675f781108bed6d7ce65fdaf770b96c2e258 /lib/rbcodec/metadata/tta.c
parentbe16edc94b9b44da6b83235fab248fa8a31126fb (diff)
downloadrockbox-76ec55cc49e306a54ac7e43acf8a7f70ba7905a0.tar.gz
rockbox-76ec55cc49e306a54ac7e43acf8a7f70ba7905a0.zip
Remove ATRAC3 specific fields (channels, extradata_size) from mp3entry
Also fixes typo of using never initialized id3->channels in wav metadata (introduced in 2d1937a1) Change-Id: I28cddec2b9d9bd1e756ffaa004b4f6e8528a7566
Diffstat (limited to 'lib/rbcodec/metadata/tta.c')
-rw-r--r--lib/rbcodec/metadata/tta.c8
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);