mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-03 11:21:41 +02:00
fix mem leak
This commit is contained in:
parent
dbd0b018e2
commit
211b5afdd3
3 changed files with 19 additions and 7 deletions
|
@ -50,6 +50,15 @@ public:
|
|||
|
||||
~PcmChunk() override = default;
|
||||
|
||||
template <class Rep, class Period>
|
||||
int readFrames(void* outputBuffer, const std::chrono::duration<Rep, Period>& duration)
|
||||
{
|
||||
auto us = std::chrono::microseconds(duration).count();
|
||||
auto frames = (us * 48000) / std::micro::den;
|
||||
// return readFrames(outputBuffer, (us * 48000) / std::micro::den);
|
||||
return frames;
|
||||
}
|
||||
|
||||
int readFrames(void* outputBuffer, size_t frameCount)
|
||||
{
|
||||
// logd << "read: " << frameCount << ", total: " << (wireChunk->length / format.frameSize) << ", idx: " << idx;// << std::endl;
|
||||
|
@ -123,6 +132,6 @@ public:
|
|||
private:
|
||||
uint32_t idx_;
|
||||
};
|
||||
}
|
||||
} // namespace msg
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue