From 76ec55cc49e306a54ac7e43acf8a7f70ba7905a0 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Wed, 24 Jan 2024 12:28:27 +0200 Subject: 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 --- lib/rbcodec/metadata/tta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/rbcodec/metadata/tta.c') 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) /* skip check CRC */ - id3->channels = (GET_HEADER(ttahdr, NUM_CHANNELS)); + unsigned short channels = (GET_HEADER(ttahdr, NUM_CHANNELS)); id3->frequency = (GET_HEADER(ttahdr, SAMPLE_RATE)); id3->length = ((GET_HEADER(ttahdr, DATA_LENGTH)) / id3->frequency) * 1000LL; bps = (GET_HEADER(ttahdr, BITS_PER_SAMPLE)); datasize = id3->filesize - id3->first_frame_offset; - origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * id3->channels; + origsize = (GET_HEADER(ttahdr, DATA_LENGTH)) * ((bps + 7) / 8) * channels; - id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * id3->channels * bps + id3->bitrate = (int) ((uint64_t) datasize * id3->frequency * channels * bps / (origsize * 1000LL)); /* output header info (for debug) */ DEBUGF("TTA header info ----\n"); DEBUGF("id: %x\n", (unsigned int)(GET_HEADER(ttahdr, ID))); - DEBUGF("channels: %d\n", id3->channels); + DEBUGF("channels: %d\n", channels); DEBUGF("frequency: %ld\n", id3->frequency); DEBUGF("length: %ld\n", id3->length); DEBUGF("bitrate: %d\n", id3->bitrate); -- cgit v1.2.3