Merge tag 'v0.20.7'
release v0.20.7
This commit is contained in:
@@ -89,7 +89,7 @@ audio_output_detect()
|
||||
*/
|
||||
gcc_pure
|
||||
static MixerType
|
||||
audio_output_mixer_type(const ConfigBlock &block)
|
||||
audio_output_mixer_type(const ConfigBlock &block) noexcept
|
||||
{
|
||||
/* read the local "mixer_type" setting */
|
||||
const char *p = block.GetBlockValue("mixer_type");
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "Internal.hxx"
|
||||
|
||||
bool
|
||||
AudioOutput::IsChunkConsumed(const MusicChunk &chunk) const
|
||||
AudioOutput::IsChunkConsumed(const MusicChunk &chunk) const noexcept
|
||||
{
|
||||
if (!open)
|
||||
return true;
|
||||
|
||||
@@ -212,10 +212,10 @@ public:
|
||||
* Caller must lock the mutex.
|
||||
*/
|
||||
gcc_pure
|
||||
bool IsChunkConsumed(const MusicChunk &chunk) const;
|
||||
bool IsChunkConsumed(const MusicChunk &chunk) const noexcept;
|
||||
|
||||
gcc_pure
|
||||
bool LockIsChunkConsumed(const MusicChunk &chunk) {
|
||||
bool LockIsChunkConsumed(const MusicChunk &chunk) noexcept {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
return IsChunkConsumed(chunk);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ MultipleOutputs::AddNullOutput(EventLoop &event_loop,
|
||||
}
|
||||
|
||||
AudioOutputControl *
|
||||
MultipleOutputs::FindByName(const char *name)
|
||||
MultipleOutputs::FindByName(const char *name) noexcept
|
||||
{
|
||||
for (auto *i : outputs)
|
||||
if (strcmp(i->GetName(), name) == 0)
|
||||
@@ -134,7 +134,7 @@ MultipleOutputs::EnableDisable()
|
||||
}
|
||||
|
||||
bool
|
||||
MultipleOutputs::AllFinished() const
|
||||
MultipleOutputs::AllFinished() const noexcept
|
||||
{
|
||||
for (auto *ao : outputs) {
|
||||
const std::lock_guard<Mutex> protect(ao->mutex);
|
||||
@@ -146,7 +146,7 @@ MultipleOutputs::AllFinished() const
|
||||
}
|
||||
|
||||
void
|
||||
MultipleOutputs::WaitAll()
|
||||
MultipleOutputs::WaitAll() noexcept
|
||||
{
|
||||
while (!AllFinished())
|
||||
audio_output_client_notify.Wait();
|
||||
@@ -257,7 +257,7 @@ MultipleOutputs::Open(const AudioFormat audio_format,
|
||||
}
|
||||
|
||||
bool
|
||||
MultipleOutputs::IsChunkConsumed(const MusicChunk *chunk) const
|
||||
MultipleOutputs::IsChunkConsumed(const MusicChunk *chunk) const noexcept
|
||||
{
|
||||
for (auto *ao : outputs)
|
||||
if (!ao->LockIsChunkConsumed(*chunk))
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* Returns nullptr if the name does not exist.
|
||||
*/
|
||||
gcc_pure
|
||||
AudioOutputControl *FindByName(const char *name);
|
||||
AudioOutputControl *FindByName(const char *name) noexcept;
|
||||
|
||||
/**
|
||||
* Checks the "enabled" flag of all audio outputs, and if one has
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
* 0..100). Returns -1 if no mixer can be queried.
|
||||
*/
|
||||
gcc_pure
|
||||
int GetVolume() const;
|
||||
int GetVolume() const noexcept;
|
||||
|
||||
/**
|
||||
* Sets the volume on all available mixers.
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
* @param volume the volume (range 0..100)
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool SetVolume(unsigned volume);
|
||||
bool SetVolume(unsigned volume) noexcept;
|
||||
|
||||
/**
|
||||
* Similar to GetVolume(), but gets the volume only for
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
* function fails if no software mixer is configured.
|
||||
*/
|
||||
gcc_pure
|
||||
int GetSoftwareVolume() const;
|
||||
int GetSoftwareVolume() const noexcept;
|
||||
|
||||
/**
|
||||
* Similar to SetVolume(), but sets the volume only for
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
* function cannot fail, because the underlying software
|
||||
* mixers cannot fail either.
|
||||
*/
|
||||
void SetSoftwareVolume(unsigned volume);
|
||||
void SetSoftwareVolume(unsigned volume) noexcept;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -232,9 +232,9 @@ private:
|
||||
* command.
|
||||
*/
|
||||
gcc_pure
|
||||
bool AllFinished() const;
|
||||
bool AllFinished() const noexcept;
|
||||
|
||||
void WaitAll();
|
||||
void WaitAll() noexcept;
|
||||
|
||||
/**
|
||||
* Signals all audio outputs which are open.
|
||||
@@ -252,7 +252,7 @@ private:
|
||||
/**
|
||||
* Has this chunk been consumed by all audio outputs?
|
||||
*/
|
||||
bool IsChunkConsumed(const MusicChunk *chunk) const;
|
||||
bool IsChunkConsumed(const MusicChunk *chunk) const noexcept;
|
||||
|
||||
/**
|
||||
* There's only one chunk left in the pipe (#pipe), and all
|
||||
|
||||
@@ -64,7 +64,7 @@ ao_plugin_close(AudioOutput &ao)
|
||||
}
|
||||
|
||||
std::chrono::steady_clock::duration
|
||||
ao_plugin_delay(AudioOutput &ao)
|
||||
ao_plugin_delay(AudioOutput &ao) noexcept
|
||||
{
|
||||
return ao.plugin.delay != nullptr
|
||||
? ao.plugin.delay(&ao)
|
||||
|
||||
@@ -102,7 +102,7 @@ struct AudioOutputPlugin {
|
||||
*
|
||||
* @return the duration to wait
|
||||
*/
|
||||
std::chrono::steady_clock::duration (*delay)(AudioOutput *data);
|
||||
std::chrono::steady_clock::duration (*delay)(AudioOutput *data) noexcept;
|
||||
|
||||
/**
|
||||
* Display metadata for the next chunk. Optional method,
|
||||
@@ -184,7 +184,7 @@ ao_plugin_close(AudioOutput &ao);
|
||||
|
||||
gcc_pure
|
||||
std::chrono::steady_clock::duration
|
||||
ao_plugin_delay(AudioOutput &ao);
|
||||
ao_plugin_delay(AudioOutput &ao) noexcept;
|
||||
|
||||
void
|
||||
ao_plugin_send_tag(AudioOutput &ao, const Tag &tag);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "MusicPipe.hxx"
|
||||
|
||||
const MusicChunk *
|
||||
SharedPipeConsumer::Get()
|
||||
SharedPipeConsumer::Get() noexcept
|
||||
{
|
||||
if (chunk != nullptr) {
|
||||
if (!consumed)
|
||||
@@ -42,7 +42,7 @@ SharedPipeConsumer::Get()
|
||||
}
|
||||
|
||||
bool
|
||||
SharedPipeConsumer::IsConsumed(const MusicChunk &_chunk) const
|
||||
SharedPipeConsumer::IsConsumed(const MusicChunk &_chunk) const noexcept
|
||||
{
|
||||
if (chunk == nullptr)
|
||||
return false;
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
chunk = nullptr;
|
||||
}
|
||||
|
||||
const MusicChunk *Get();
|
||||
const MusicChunk *Get() noexcept;
|
||||
|
||||
void Consume(gcc_unused const MusicChunk &_chunk) {
|
||||
assert(chunk != nullptr);
|
||||
@@ -85,9 +85,9 @@ public:
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
bool IsConsumed(const MusicChunk &_chunk) const;
|
||||
bool IsConsumed(const MusicChunk &_chunk) const noexcept;
|
||||
|
||||
void ClearTail(gcc_unused const MusicChunk &_chunk) {
|
||||
void ClearTail(gcc_unused const MusicChunk &_chunk) noexcept {
|
||||
assert(chunk == &_chunk);
|
||||
assert(consumed);
|
||||
chunk = nullptr;
|
||||
|
||||
@@ -60,7 +60,7 @@ AudioOutputSource::Open(AudioFormat audio_format, const MusicPipe &_pipe,
|
||||
}
|
||||
|
||||
void
|
||||
AudioOutputSource::Close()
|
||||
AudioOutputSource::Close() noexcept
|
||||
{
|
||||
assert(in_audio_format.IsValid());
|
||||
in_audio_format.Clear();
|
||||
@@ -71,7 +71,7 @@ AudioOutputSource::Close()
|
||||
}
|
||||
|
||||
void
|
||||
AudioOutputSource::Cancel()
|
||||
AudioOutputSource::Cancel() noexcept
|
||||
{
|
||||
current_chunk = nullptr;
|
||||
pipe.Cancel();
|
||||
@@ -114,7 +114,7 @@ try {
|
||||
}
|
||||
|
||||
void
|
||||
AudioOutputSource::CloseFilter()
|
||||
AudioOutputSource::CloseFilter() noexcept
|
||||
{
|
||||
delete replay_gain_filter_instance;
|
||||
replay_gain_filter_instance = nullptr;
|
||||
|
||||
@@ -138,8 +138,8 @@ public:
|
||||
PreparedFilter *prepared_other_replay_gain_filter,
|
||||
PreparedFilter *prepared_filter);
|
||||
|
||||
void Close();
|
||||
void Cancel();
|
||||
void Close() noexcept;
|
||||
void Cancel() noexcept;
|
||||
|
||||
/**
|
||||
* Ensure that ReadTag() or PeekData() return any input.
|
||||
@@ -181,13 +181,13 @@ public:
|
||||
*/
|
||||
void ConsumeData(size_t nbytes) noexcept;
|
||||
|
||||
bool IsChunkConsumed(const MusicChunk &chunk) const {
|
||||
bool IsChunkConsumed(const MusicChunk &chunk) const noexcept {
|
||||
assert(IsOpen());
|
||||
|
||||
return pipe.IsConsumed(chunk);
|
||||
}
|
||||
|
||||
void ClearTailChunk(const MusicChunk &chunk) {
|
||||
void ClearTailChunk(const MusicChunk &chunk) noexcept {
|
||||
pipe.ClearTail(chunk);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
PreparedFilter *prepared_other_replay_gain_filter,
|
||||
PreparedFilter *prepared_filter);
|
||||
|
||||
void CloseFilter();
|
||||
void CloseFilter() noexcept;
|
||||
|
||||
ConstBuffer<void> GetChunkData(const MusicChunk &chunk,
|
||||
Filter *replay_gain_filter,
|
||||
|
||||
@@ -65,12 +65,11 @@ struct AudioOutputWrapper {
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static std::chrono::steady_clock::duration Delay(AudioOutput *ao) {
|
||||
static std::chrono::steady_clock::duration Delay(AudioOutput *ao) noexcept {
|
||||
T &t = Cast(*ao);
|
||||
return t.Delay();
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static void SendTag(AudioOutput *ao, const Tag &tag) {
|
||||
T &t = Cast(*ao);
|
||||
t.SendTag(tag);
|
||||
@@ -91,7 +90,6 @@ struct AudioOutputWrapper {
|
||||
t.Cancel();
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
static bool Pause(AudioOutput *ao) {
|
||||
T &t = Cast(*ao);
|
||||
return t.Pause();
|
||||
|
||||
@@ -483,7 +483,7 @@ alsa_test_default_device()
|
||||
*/
|
||||
gcc_const
|
||||
static snd_pcm_format_t
|
||||
ToAlsaPcmFormat(SampleFormat sample_format)
|
||||
ToAlsaPcmFormat(SampleFormat sample_format) noexcept
|
||||
{
|
||||
switch (sample_format) {
|
||||
case SampleFormat::UNDEFINED:
|
||||
@@ -521,7 +521,7 @@ ToAlsaPcmFormat(SampleFormat sample_format)
|
||||
* SND_PCM_FORMAT_UNKNOWN if the format cannot be byte-swapped.
|
||||
*/
|
||||
static snd_pcm_format_t
|
||||
ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt)
|
||||
ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
||||
{
|
||||
switch (fmt) {
|
||||
case SND_PCM_FORMAT_S16_LE: return SND_PCM_FORMAT_S16_BE;
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
void Open(AudioFormat &audio_format);
|
||||
void Close();
|
||||
|
||||
std::chrono::steady_clock::duration Delay() const;
|
||||
std::chrono::steady_clock::duration Delay() const noexcept;
|
||||
size_t Play(const void *chunk, size_t size);
|
||||
void Cancel();
|
||||
};
|
||||
@@ -206,7 +206,7 @@ FifoOutput::Cancel()
|
||||
}
|
||||
|
||||
inline std::chrono::steady_clock::duration
|
||||
FifoOutput::Delay() const
|
||||
FifoOutput::Delay() const noexcept
|
||||
{
|
||||
return timer->IsStarted()
|
||||
? timer->GetDelay()
|
||||
|
||||
@@ -119,7 +119,7 @@ struct JackOutput {
|
||||
* on all channels.
|
||||
*/
|
||||
gcc_pure
|
||||
jack_nframes_t GetAvailable() const;
|
||||
jack_nframes_t GetAvailable() const noexcept;
|
||||
|
||||
void Process(jack_nframes_t nframes);
|
||||
|
||||
@@ -128,7 +128,7 @@ struct JackOutput {
|
||||
*/
|
||||
size_t WriteSamples(const float *src, size_t n_frames);
|
||||
|
||||
std::chrono::steady_clock::duration Delay() const {
|
||||
std::chrono::steady_clock::duration Delay() const noexcept {
|
||||
return base.pause && pause && !shutdown
|
||||
? std::chrono::seconds(1)
|
||||
: std::chrono::steady_clock::duration::zero();
|
||||
@@ -215,7 +215,7 @@ JackOutput::JackOutput(const ConfigBlock &block)
|
||||
}
|
||||
|
||||
inline jack_nframes_t
|
||||
JackOutput::GetAvailable() const
|
||||
JackOutput::GetAvailable() const noexcept
|
||||
{
|
||||
size_t min = jack_ringbuffer_read_space(ringbuffer[0]);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
delete timer;
|
||||
}
|
||||
|
||||
std::chrono::steady_clock::duration Delay() const {
|
||||
std::chrono::steady_clock::duration Delay() const noexcept {
|
||||
return sync && timer->IsStarted()
|
||||
? timer->GetDelay()
|
||||
: std::chrono::steady_clock::duration::zero();
|
||||
|
||||
@@ -59,7 +59,7 @@ class OpenALOutput {
|
||||
void Close();
|
||||
|
||||
gcc_pure
|
||||
std::chrono::steady_clock::duration Delay() const {
|
||||
std::chrono::steady_clock::duration Delay() const noexcept {
|
||||
return filled < NUM_BUFFERS || HasProcessed()
|
||||
? std::chrono::steady_clock::duration::zero()
|
||||
/* we don't know exactly how long we must wait
|
||||
|
||||
@@ -392,7 +392,7 @@ oss_setup_sample_rate(int fd, AudioFormat &audio_format)
|
||||
*/
|
||||
gcc_const
|
||||
static int
|
||||
sample_format_to_oss(SampleFormat format)
|
||||
sample_format_to_oss(SampleFormat format) noexcept
|
||||
{
|
||||
switch (format) {
|
||||
case SampleFormat::UNDEFINED:
|
||||
@@ -431,7 +431,7 @@ sample_format_to_oss(SampleFormat format)
|
||||
*/
|
||||
gcc_const
|
||||
static SampleFormat
|
||||
sample_format_from_oss(int format)
|
||||
sample_format_from_oss(int format) noexcept
|
||||
{
|
||||
switch (format) {
|
||||
case AFMT_S8:
|
||||
|
||||
@@ -90,7 +90,6 @@ public:
|
||||
Signal();
|
||||
}
|
||||
|
||||
gcc_const
|
||||
static bool TestDefaultDevice();
|
||||
|
||||
static PulseOutput *Create(EventLoop &event_loop,
|
||||
|
||||
@@ -77,7 +77,7 @@ static constexpr Domain roar_output_domain("roar_output");
|
||||
|
||||
gcc_pure
|
||||
static int
|
||||
GetConfiguredRole(const ConfigBlock &block)
|
||||
GetConfiguredRole(const ConfigBlock &block) noexcept
|
||||
{
|
||||
const char *role = block.GetBlockValue("role");
|
||||
return role != nullptr
|
||||
|
||||
@@ -64,7 +64,7 @@ struct ShoutOutput final {
|
||||
void Open(AudioFormat &audio_format);
|
||||
void Close();
|
||||
|
||||
std::chrono::steady_clock::duration Delay() const;
|
||||
std::chrono::steady_clock::duration Delay() const noexcept;
|
||||
void SendTag(const Tag &tag);
|
||||
size_t Play(const void *chunk, size_t size);
|
||||
void Cancel();
|
||||
@@ -75,7 +75,6 @@ static int shout_init_count;
|
||||
|
||||
static constexpr Domain shout_output_domain("shout_output");
|
||||
|
||||
gcc_pure
|
||||
static const char *
|
||||
require_block_string(const ConfigBlock &block, const char *name)
|
||||
{
|
||||
@@ -362,7 +361,7 @@ ShoutOutput::Open(AudioFormat &audio_format)
|
||||
}
|
||||
|
||||
std::chrono::steady_clock::duration
|
||||
ShoutOutput::Delay() const
|
||||
ShoutOutput::Delay() const noexcept
|
||||
{
|
||||
int delay = shout_delay(shout_conn);
|
||||
if (delay < 0)
|
||||
|
||||
@@ -249,7 +249,7 @@ HttpdClient::TryWritePageN(const Page &page, size_t position, ssize_t n)
|
||||
}
|
||||
|
||||
ssize_t
|
||||
HttpdClient::GetBytesTillMetaData() const
|
||||
HttpdClient::GetBytesTillMetaData() const noexcept
|
||||
{
|
||||
if (metadata_requested &&
|
||||
current_page->GetSize() - current_position > metaint - metadata_fill)
|
||||
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
bool SendResponse();
|
||||
|
||||
gcc_pure
|
||||
ssize_t GetBytesTillMetaData() const;
|
||||
ssize_t GetBytesTillMetaData() const noexcept;
|
||||
|
||||
ssize_t TryWritePage(const Page &page, size_t position);
|
||||
ssize_t TryWritePageN(const Page &page, size_t position, ssize_t n);
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
void SendHeader(HttpdClient &client) const;
|
||||
|
||||
gcc_pure
|
||||
std::chrono::steady_clock::duration Delay() const;
|
||||
std::chrono::steady_clock::duration Delay() const noexcept;
|
||||
|
||||
/**
|
||||
* Reads data from the encoder (as much as available) and
|
||||
|
||||
@@ -300,7 +300,7 @@ HttpdOutput::SendHeader(HttpdClient &client) const
|
||||
}
|
||||
|
||||
inline std::chrono::steady_clock::duration
|
||||
HttpdOutput::Delay() const
|
||||
HttpdOutput::Delay() const noexcept
|
||||
{
|
||||
if (!LockHasClients() && base.pause) {
|
||||
/* if there's no client and this output is paused,
|
||||
|
||||
Reference in New Issue
Block a user