Reformat code

This commit is contained in:
badaix 2020-03-14 11:29:27 +01:00
parent 3a8023ab93
commit e15800450e
2 changed files with 11 additions and 11 deletions

View file

@ -45,14 +45,14 @@ Stream::Stream(const SampleFormat& in_format, const SampleFormat& out_format)
out_format.channels() != 0 ? out_format.channels() : format_.channels()); out_format.channels() != 0 ? out_format.channels() : format_.channels());
} }
/* /*
48000 x 48000 x
------- = ----- ------- = -----
47999,2 x - 1 47999,2 x - 1
x = 1,000016667 / (1,000016667 - 1) x = 1,000016667 / (1,000016667 - 1)
*/ */
// setRealSampleRate(format_.rate()); // setRealSampleRate(format_.rate());
#ifdef HAS_SOXR #ifdef HAS_SOXR
soxr_ = nullptr; soxr_ = nullptr;
if ((format_.rate() != in_format_.rate()) || (format_.bits() != in_format_.bits())) if ((format_.rate() != in_format_.rate()) || (format_.bits() != in_format_.bits()))
@ -126,7 +126,7 @@ void Stream::addChunk(unique_ptr<msg::PcmChunk> chunk)
if (age > 5s + bufferMs_) if (age > 5s + bufferMs_)
return; return;
// LOG(DEBUG, LOG_TAG) << "new chunk: " << chunk->durationMs() << " ms, Chunks: " << chunks_.size() << "\n"; // LOG(DEBUG, LOG_TAG) << "new chunk: " << chunk->durationMs() << " ms, Chunks: " << chunks_.size() << "\n";
#ifndef HAS_SOXR #ifndef HAS_SOXR
chunks_.push(move(chunk)); chunks_.push(move(chunk));

View file

@ -60,7 +60,7 @@ public:
bool waitForChunk(const std::chrono::milliseconds& timeout) const; bool waitForChunk(const std::chrono::milliseconds& timeout) const;
private: private:
/// Request an audio chunk from the front of the stream. /// Request an audio chunk from the front of the stream.
/// @param outputBuffer will be filled with the chunk /// @param outputBuffer will be filled with the chunk
/// @param frames the number of requested frames /// @param frames the number of requested frames
/// @return the timepoint when this chunk should be audible /// @return the timepoint when this chunk should be audible
@ -69,10 +69,10 @@ private:
/// Request an audio chunk from the front of the stream with a tempo adaption /// Request an audio chunk from the front of the stream with a tempo adaption
/// @param outputBuffer will be filled with the chunk /// @param outputBuffer will be filled with the chunk
/// @param frames the number of requested frames /// @param frames the number of requested frames
/// @param framesCorrection number of frames that should be added or removed. /// @param framesCorrection number of frames that should be added or removed.
/// The function will allways return "frames" frames, but will fit "frames + framesCorrection" frames into "frames" /// The function will allways return "frames" frames, but will fit "frames + framesCorrection" frames into "frames"
/// so if frames is 100 and framesCorrection is 2, 102 frames will be read from the stream and 2 frames will be removed. /// so if frames is 100 and framesCorrection is 2, 102 frames will be read from the stream and 2 frames will be removed.
/// This makes us "fast-forward" by 2 frames, or if framesCorrection is -3, 97 frames will be read from the stream and /// This makes us "fast-forward" by 2 frames, or if framesCorrection is -3, 97 frames will be read from the stream and
/// filled with 3 frames (simply by dublication), this makes us effectively slower /// filled with 3 frames (simply by dublication), this makes us effectively slower
/// @return the timepoint when this chunk should be audible /// @return the timepoint when this chunk should be audible
chronos::time_point_clk getNextPlayerChunk(void* outputBuffer, uint32_t frames, int32_t framesCorrection); chronos::time_point_clk getNextPlayerChunk(void* outputBuffer, uint32_t frames, int32_t framesCorrection);