aboutsummaryrefslogtreecommitdiffstats
path: root/src/rm.cpp
diff options
context:
space:
mode:
authorDaniil Cheredni <dan.cherednik@gmail.com>2024-10-21 21:53:55 +0200
committerDaniil Cherednik <dan.cherednik@gmail.com>2024-11-01 18:21:42 +0100
commitd459470e2d8c1cdfc633584b277505ef03565ab1 (patch)
treeaf7676bd204836e357c1034a8138ce7f472db47c /src/rm.cpp
parentfe377370c1ae4691a65270123345f225e3159ed8 (diff)
downloadatracdenc-d459470e2d8c1cdfc633584b277505ef03565ab1.tar.gz
Do not use 8bit, 16bit types if do not realy need it.
Diffstat (limited to 'src/rm.cpp')
-rw-r--r--src/rm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rm.cpp b/src/rm.cpp
index d4de66e..4d04cb7 100644
--- a/src/rm.cpp
+++ b/src/rm.cpp
@@ -62,7 +62,7 @@ constexpr char RA_DESC[] = "Audio Stream";
static_assert(sizeof(char) == 1, "unexpected char size");
constexpr size_t MDPR_HEADER_SZ = 42 + sizeof(RA_MIME) + sizeof(RA_DESC) + CODEC_DATA_SZ;
-void FillCodecData(char* buf, uint32_t frameSize, uint8_t numChannels, bool jointStereo, uint32_t bitrate) {
+void FillCodecData(char* buf, uint32_t frameSize, size_t numChannels, bool jointStereo, uint32_t bitrate) {
*reinterpret_cast<uint32_t*>(buf + 0) = swapbyte32_on_le(CODEC_DATA_SZ - 4); // -4 - without size of `size` field
buf[4] = '.';
buf[5] = 'r';
@@ -147,7 +147,7 @@ void scramble_data(const char* input, char* out, size_t bytes) {
class TRm : public ICompressedOutput {
public:
- TRm(const std::string& filename, const std::string& /*title*/, uint8_t numChannels,
+ TRm(const std::string& filename, const std::string& /*title*/, size_t numChannels,
uint32_t numFrames, uint32_t frameSize, bool jointStereo)
: File_(OpenFile(filename))
, FrameDuration_((1000.0 * 1024.0 / 44100.0)) // ms
@@ -194,7 +194,7 @@ public:
return {};
}
- uint8_t GetChannelNum() const override {
+ size_t GetChannelNum() const override {
return 0;
}
@@ -251,7 +251,7 @@ private:
throw std::runtime_error("Can't write PROP header");//, errno);
}
- void WriteMDPR(uint32_t frameSize, uint32_t numFrames, uint8_t numChannels, bool jointStereo) {
+ void WriteMDPR(uint32_t frameSize, uint32_t numFrames, size_t numChannels, bool jointStereo) {
char buf[MDPR_HEADER_SZ] = {
'M', 'D', 'P', 'R'};
*reinterpret_cast<uint32_t*>(buf + 4) = swapbyte32_on_le(MDPR_HEADER_SZ);
@@ -276,7 +276,7 @@ private:
}
};
-TCompressedOutputPtr CreateRmOutput(const std::string& filename, const std::string& title, uint8_t numChannel,
+TCompressedOutputPtr CreateRmOutput(const std::string& filename, const std::string& title, size_t numChannel,
uint32_t numFrames, uint32_t framesize, bool jointStereo) {
return std::unique_ptr<TRm>(new TRm(filename, title, numChannel, numFrames, framesize, jointStereo));
}