summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/Bridge.cxx6
-rw-r--r--src/decoder/Bridge.hxx6
-rw-r--r--src/decoder/Client.hxx6
-rw-r--r--src/decoder/DecoderBuffer.hxx10
-rw-r--r--src/decoder/DecoderControl.hxx10
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx4
-rw-r--r--src/decoder/plugins/FlacMetadata.hxx20
-rw-r--r--src/decoder/plugins/OpusDecoderPlugin.cxx4
8 files changed, 35 insertions, 31 deletions
diff --git a/src/decoder/Bridge.cxx b/src/decoder/Bridge.cxx
index c24c80768..37fcb2bf9 100644
--- a/src/decoder/Bridge.cxx
+++ b/src/decoder/Bridge.cxx
@@ -277,7 +277,7 @@ DecoderBridge::Ready(const AudioFormat audio_format,
}
DecoderCommand
-DecoderBridge::GetCommand()
+DecoderBridge::GetCommand() noexcept
{
return LockGetVirtualCommand();
}
@@ -326,7 +326,7 @@ DecoderBridge::CommandFinished()
}
SongTime
-DecoderBridge::GetSeekTime()
+DecoderBridge::GetSeekTime() noexcept
{
assert(dc.pipe != nullptr);
@@ -341,7 +341,7 @@ DecoderBridge::GetSeekTime()
}
uint64_t
-DecoderBridge::GetSeekFrame()
+DecoderBridge::GetSeekFrame() noexcept
{
return GetSeekTime().ToScale<uint64_t>(dc.in_audio_format.sample_rate);
}
diff --git a/src/decoder/Bridge.hxx b/src/decoder/Bridge.hxx
index 8573d6a7f..3b354c063 100644
--- a/src/decoder/Bridge.hxx
+++ b/src/decoder/Bridge.hxx
@@ -134,10 +134,10 @@ public:
/* virtual methods from DecoderClient */
void Ready(AudioFormat audio_format,
bool seekable, SignedSongTime duration) override;
- DecoderCommand GetCommand() override;
+ DecoderCommand GetCommand() noexcept override;
void CommandFinished() override;
- SongTime GetSeekTime() override;
- uint64_t GetSeekFrame() override;
+ SongTime GetSeekTime() noexcept override;
+ uint64_t GetSeekFrame() noexcept override;
void SeekError() override;
InputStreamPtr OpenUri(const char *uri) override;
size_t Read(InputStream &is, void *buffer, size_t length) override;
diff --git a/src/decoder/Client.hxx b/src/decoder/Client.hxx
index 8de82d155..87f19f5be 100644
--- a/src/decoder/Client.hxx
+++ b/src/decoder/Client.hxx
@@ -58,7 +58,7 @@ public:
* command pending
*/
gcc_pure
- virtual DecoderCommand GetCommand() = 0;
+ virtual DecoderCommand GetCommand() noexcept = 0;
/**
* Called by the decoder when it has performed the requested command
@@ -73,7 +73,7 @@ public:
* @return the destination position for the seek in milliseconds
*/
gcc_pure
- virtual SongTime GetSeekTime() = 0;
+ virtual SongTime GetSeekTime() noexcept = 0;
/**
* Call this when you have received the DecoderCommand::SEEK command.
@@ -81,7 +81,7 @@ public:
* @return the destination position for the seek in frames
*/
gcc_pure
- virtual uint64_t GetSeekFrame() = 0;
+ virtual uint64_t GetSeekFrame() noexcept = 0;
/**
* Call this instead of CommandFinished() when seeking has
diff --git a/src/decoder/DecoderBuffer.hxx b/src/decoder/DecoderBuffer.hxx
index c79f8d96c..a7ba2f85f 100644
--- a/src/decoder/DecoderBuffer.hxx
+++ b/src/decoder/DecoderBuffer.hxx
@@ -54,11 +54,11 @@ public:
size_t _size)
:client(_client), is(_is), buffer(_size) {}
- const InputStream &GetStream() const {
+ const InputStream &GetStream() const noexcept {
return is;
}
- void Clear() {
+ void Clear() noexcept {
buffer.Clear();
}
@@ -75,7 +75,7 @@ public:
* How many bytes are stored in the buffer?
*/
gcc_pure
- size_t GetAvailable() const {
+ size_t GetAvailable() const noexcept {
return buffer.GetAvailable();
}
@@ -84,7 +84,7 @@ public:
* you have to call Consume() to do that. The returned buffer
* becomes invalid after a Fill() or a Consume() call.
*/
- ConstBuffer<void> Read() const {
+ ConstBuffer<void> Read() const noexcept {
auto r = buffer.Read();
return { r.data, r.size };
}
@@ -102,7 +102,7 @@ public:
*
* @param nbytes the number of bytes to consume
*/
- void Consume(size_t nbytes) {
+ void Consume(size_t nbytes) noexcept {
buffer.Consume(nbytes);
}
diff --git a/src/decoder/DecoderControl.hxx b/src/decoder/DecoderControl.hxx
index 926f74343..dfd8232e6 100644
--- a/src/decoder/DecoderControl.hxx
+++ b/src/decoder/DecoderControl.hxx
@@ -227,29 +227,29 @@ struct DecoderControl {
}
gcc_pure
- bool LockIsIdle() const {
+ bool LockIsIdle() const noexcept {
const std::lock_guard<Mutex> protect(mutex);
return IsIdle();
}
- bool IsStarting() const {
+ bool IsStarting() const noexcept {
return state == DecoderState::START;
}
gcc_pure
- bool LockIsStarting() const {
+ bool LockIsStarting() const noexcept {
const std::lock_guard<Mutex> protect(mutex);
return IsStarting();
}
- bool HasFailed() const {
+ bool HasFailed() const noexcept {
assert(command == DecoderCommand::NONE);
return state == DecoderState::ERROR;
}
gcc_pure
- bool LockHasFailed() const {
+ bool LockHasFailed() const noexcept {
const std::lock_guard<Mutex> protect(mutex);
return HasFailed();
}
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 1380bf94b..a035e058c 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -881,7 +881,8 @@ ffmpeg_scan_stream(InputStream &is,
* more formats.
*/
static const char *const ffmpeg_suffixes[] = {
- "16sv", "3g2", "3gp", "4xm", "8svx", "aa3", "aac", "ac3", "afc", "aif",
+ "16sv", "3g2", "3gp", "4xm", "8svx",
+ "aa3", "aac", "ac3", "adx", "afc", "aif",
"aifc", "aiff", "al", "alaw", "amr", "anim", "apc", "ape", "asf",
"atrac", "au", "aud", "avi", "avm2", "avs", "bap", "bfi", "c93", "cak",
"cin", "cmv", "cpk", "daud", "dct", "divx", "dts", "dv", "dvd", "dxa",
@@ -934,6 +935,7 @@ static const char *const ffmpeg_mime_types[] = {
"audio/x-16sv",
"audio/x-aac",
"audio/x-ac3",
+ "audio/x-adx",
"audio/x-aiff"
"audio/x-alaw",
"audio/x-au",
diff --git a/src/decoder/plugins/FlacMetadata.hxx b/src/decoder/plugins/FlacMetadata.hxx
index ede627aa1..d0ee8c824 100644
--- a/src/decoder/plugins/FlacMetadata.hxx
+++ b/src/decoder/plugins/FlacMetadata.hxx
@@ -42,25 +42,27 @@ public:
return chain;
}
- bool Read(const char *path) {
+ bool Read(const char *path) noexcept {
return ::FLAC__metadata_chain_read(chain, path);
}
- bool Read(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) {
+ bool Read(FLAC__IOHandle handle,
+ FLAC__IOCallbacks callbacks) noexcept {
return ::FLAC__metadata_chain_read_with_callbacks(chain,
handle,
callbacks);
}
- bool Read(InputStream &is) {
+ bool Read(InputStream &is) noexcept {
return Read(::ToFlacIOHandle(is), ::GetFlacIOCallbacks(is));
}
- bool ReadOgg(const char *path) {
+ bool ReadOgg(const char *path) noexcept {
return ::FLAC__metadata_chain_read_ogg(chain, path);
}
- bool ReadOgg(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) {
+ bool ReadOgg(FLAC__IOHandle handle,
+ FLAC__IOCallbacks callbacks) noexcept {
return ::FLAC__metadata_chain_read_ogg_with_callbacks(chain,
handle,
callbacks);
@@ -71,12 +73,12 @@ public:
}
gcc_pure
- FLAC__Metadata_ChainStatus GetStatus() const {
+ FLAC__Metadata_ChainStatus GetStatus() const noexcept {
return ::FLAC__metadata_chain_status(chain);
}
gcc_pure
- const char *GetStatusString() const {
+ const char *GetStatusString() const noexcept {
return FLAC__Metadata_ChainStatusString[GetStatus()];
}
@@ -99,12 +101,12 @@ public:
::FLAC__metadata_iterator_delete(iterator);
}
- bool Next() {
+ bool Next() noexcept {
return ::FLAC__metadata_iterator_next(iterator);
}
gcc_pure
- FLAC__StreamMetadata *GetBlock() {
+ FLAC__StreamMetadata *GetBlock() noexcept {
return ::FLAC__metadata_iterator_get_block(iterator);
}
};
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx
index 7474bb2f2..3b9a29233 100644
--- a/src/decoder/plugins/OpusDecoderPlugin.cxx
+++ b/src/decoder/plugins/OpusDecoderPlugin.cxx
@@ -52,14 +52,14 @@ static constexpr unsigned opus_output_buffer_frames = opus_sample_rate / 4;
gcc_pure
static bool
-IsOpusHead(const ogg_packet &packet)
+IsOpusHead(const ogg_packet &packet) noexcept
{
return packet.bytes >= 8 && memcmp(packet.packet, "OpusHead", 8) == 0;
}
gcc_pure
static bool
-IsOpusTags(const ogg_packet &packet)
+IsOpusTags(const ogg_packet &packet) noexcept
{
return packet.bytes >= 8 && memcmp(packet.packet, "OpusTags", 8) == 0;
}