Merge branch 'v0.20.x'
This commit is contained in:
12
src/Main.cxx
12
src/Main.cxx
@@ -120,8 +120,16 @@ static constexpr size_t KILOBYTE = 1024;
|
||||
static constexpr size_t MEGABYTE = 1024 * KILOBYTE;
|
||||
|
||||
static constexpr size_t DEFAULT_BUFFER_SIZE = 4 * MEGABYTE;
|
||||
static constexpr size_t MIN_BUFFER_SIZE = std::max(CHUNK_SIZE * 32,
|
||||
64 * KILOBYTE);
|
||||
|
||||
static
|
||||
#if GCC_OLDER_THAN(5,0)
|
||||
/* gcc 4.x has no "constexpr" for std::max() */
|
||||
const
|
||||
#else
|
||||
constexpr
|
||||
#endif
|
||||
size_t MIN_BUFFER_SIZE = std::max(CHUNK_SIZE * 32,
|
||||
64 * KILOBYTE);
|
||||
|
||||
static constexpr unsigned DEFAULT_BUFFER_BEFORE_PLAY = 10;
|
||||
|
||||
|
@@ -81,7 +81,7 @@ public:
|
||||
size_t Play(const void *chunk, size_t size);
|
||||
void Cancel();
|
||||
|
||||
std::chrono::steady_clock::duration Delay();
|
||||
std::chrono::steady_clock::duration Delay() noexcept;
|
||||
|
||||
void FillBuffer(void* _buffer, size_t size,
|
||||
gcc_unused const media_raw_audio_format& _format);
|
||||
@@ -311,7 +311,7 @@ HaikuOutput::Play(const void *chunk, size_t size)
|
||||
}
|
||||
|
||||
inline std::chrono::steady_clock::duration
|
||||
HaikuOutput::Delay()
|
||||
HaikuOutput::Delay() noexcept
|
||||
{
|
||||
unsigned delay = buffer_filled ? 0 : buffer_delay;
|
||||
|
||||
|
@@ -670,7 +670,7 @@ osx_output_play(AudioOutput *ao, const void *chunk, size_t size)
|
||||
}
|
||||
|
||||
static std::chrono::steady_clock::duration
|
||||
osx_output_delay(AudioOutput *ao)
|
||||
osx_output_delay(AudioOutput *ao) noexcept
|
||||
{
|
||||
OSXOutput *od = (OSXOutput *)ao;
|
||||
return od->ring_buffer->write_available()
|
||||
|
@@ -101,7 +101,7 @@ public:
|
||||
void Open(AudioFormat &audio_format);
|
||||
void Close();
|
||||
|
||||
std::chrono::steady_clock::duration Delay();
|
||||
std::chrono::steady_clock::duration Delay() noexcept;
|
||||
size_t Play(const void *chunk, size_t size);
|
||||
void Cancel();
|
||||
bool Pause();
|
||||
@@ -741,7 +741,7 @@ PulseOutput::StreamPause(bool pause)
|
||||
}
|
||||
|
||||
inline std::chrono::steady_clock::duration
|
||||
PulseOutput::Delay()
|
||||
PulseOutput::Delay() noexcept
|
||||
{
|
||||
Pulse::LockGuard lock(mainloop);
|
||||
|
||||
|
@@ -98,7 +98,7 @@ public:
|
||||
void Open(AudioFormat &audio_format);
|
||||
void Close();
|
||||
|
||||
std::chrono::steady_clock::duration Delay() {
|
||||
std::chrono::steady_clock::duration Delay() noexcept {
|
||||
return pause && !cancel
|
||||
? std::chrono::milliseconds(100)
|
||||
: std::chrono::steady_clock::duration::zero();
|
||||
|
Reference in New Issue
Block a user