mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-05 04:11:50 +02:00
Replace c casts with static_casts
This commit is contained in:
parent
546e62b508
commit
d82c3c42ae
3 changed files with 6 additions and 6 deletions
|
@ -230,7 +230,7 @@ void AlsaPlayer::worker()
|
|||
continue;
|
||||
}
|
||||
|
||||
chronos::usec delay((chronos::usec::rep)(1000 * (double)framesDelay / format.msRate()));
|
||||
chronos::usec delay(static_cast<chronos::usec::rep>(1000 * (double)framesDelay / format.msRate()));
|
||||
// LOG(TRACE) << "delay: " << framesDelay << ", delay[ms]: " << delay.count() / 1000 << ", avail: " << framesAvail << "\n";
|
||||
|
||||
if (buffer_.size() < static_cast<size_t>(framesAvail * format.frameSize))
|
||||
|
|
|
@ -296,7 +296,7 @@ bool Stream::getPlayerChunk(void* outputBuffer, const cs::usec& outputBufferDacT
|
|||
{
|
||||
|
||||
// LOG(DEBUG) << "framesPerBuffer: " << framesPerBuffer << "\tms: " << framesPerBuffer*2 / PLAYER_CHUNK_MS_SIZE << "\t" << PLAYER_CHUNK_SIZE << "\n";
|
||||
cs::nsec bufferDuration = cs::nsec(cs::nsec::rep(framesPerBuffer / format_.nsRate()));
|
||||
cs::nsec bufferDuration = cs::nsec(static_cast<cs::nsec::rep>(framesPerBuffer / format_.nsRate()));
|
||||
// LOG(DEBUG) << "buffer duration: " << bufferDuration.count() << "\n";
|
||||
|
||||
cs::usec correction = cs::usec(0);
|
||||
|
@ -400,7 +400,7 @@ bool Stream::getPlayerChunk(void* outputBuffer, const cs::usec& outputBufferDacT
|
|||
else if (miniBuffer_.full() && (cs::usec(abs(miniBuffer_.median())) > cs::msec(50)))
|
||||
{
|
||||
LOG(INFO) << "pMiniBuffer->full() && (abs(pMiniBuffer->mean()) > 50): " << miniBuffer_.median() << "\n";
|
||||
sleep_ = cs::usec((cs::msec::rep)miniBuffer_.mean());
|
||||
sleep_ = cs::usec(static_cast<cs::msec::rep>(miniBuffer_.mean()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
chronos::time_point_clk start() const override
|
||||
{
|
||||
return chronos::time_point_clk(chronos::sec(timestamp.sec) + chronos::usec(timestamp.usec) +
|
||||
chronos::usec((chronos::usec::rep)(1000000. * ((double)idx_ / (double)format.rate))));
|
||||
chronos::usec(static_cast<chronos::usec::rep>(1000000. * ((double)idx_ / (double)format.rate))));
|
||||
}
|
||||
|
||||
inline chronos::time_point_clk end() const
|
||||
|
@ -101,13 +101,13 @@ public:
|
|||
template <typename T>
|
||||
inline T duration() const
|
||||
{
|
||||
return std::chrono::duration_cast<T>(chronos::nsec((chronos::nsec::rep)(1000000 * getFrameCount() / format.msRate())));
|
||||
return std::chrono::duration_cast<T>(chronos::nsec(static_cast<chronos::nsec::rep>(1000000 * getFrameCount() / format.msRate())));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T durationLeft() const
|
||||
{
|
||||
return std::chrono::duration_cast<T>(chronos::nsec((chronos::nsec::rep)(1000000 * (getFrameCount() - idx_) / format.msRate())));
|
||||
return std::chrono::duration_cast<T>(chronos::nsec(static_cast<chronos::nsec::rep>(1000000 * (getFrameCount() - idx_) / format.msRate())));
|
||||
}
|
||||
|
||||
inline bool isEndOfChunk() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue