Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ver 0.25 (not yet released)
ver 0.24.15 (not yet released)
* protocol
- fix crash on "sticker delete"
* input
- alsa, curl, nfs: fix stalled transfers
* playlist
- asx, pls, rss, xspf: limit to 16 MB
- cue: fix problem playing CUE tracks in music directory root
Expand Down
13 changes: 2 additions & 11 deletions src/input/AsyncInputStream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ AsyncInputStream::SeekDone() noexcept
open = true;

seek_state = SeekState::NONE;
caller_cond.notify_one();
InvokeOnAvailable();
}

Expand Down Expand Up @@ -207,10 +206,8 @@ AsyncInputStream::CommitWriteBuffer(size_t nbytes) noexcept

if (!IsReady())
SetReady();
else {
caller_cond.notify_one();
else
InvokeOnAvailable();
}
}

void
Expand Down Expand Up @@ -240,10 +237,8 @@ AsyncInputStream::AppendToBuffer(std::span<const std::byte> src) noexcept

if (!IsReady())
SetReady();
else {
caller_cond.notify_one();
else
InvokeOnAvailable();
}
}

void
Expand All @@ -254,7 +249,6 @@ AsyncInputStream::DeferredResume() noexcept
if (postponed_exception) [[unlikely]] {
/* do not proceed, first the caller must handle the
pending error */
caller_cond.notify_one();
InvokeOnAvailable();
return;
}
Expand All @@ -263,7 +257,6 @@ AsyncInputStream::DeferredResume() noexcept
Resume();
} catch (...) {
postponed_exception = std::current_exception();
caller_cond.notify_one();
InvokeOnAvailable();
}
}
Expand All @@ -279,7 +272,6 @@ AsyncInputStream::DeferredSeek() noexcept
/* do not proceed, first the caller must handle the
pending error */
seek_state = SeekState::NONE;
caller_cond.notify_one();
InvokeOnAvailable();
return;
}
Expand All @@ -295,7 +287,6 @@ AsyncInputStream::DeferredSeek() noexcept
} catch (...) {
seek_state = SeekState::NONE;
postponed_exception = std::current_exception();
caller_cond.notify_one();
InvokeOnAvailable();
}
}
8 changes: 8 additions & 0 deletions src/input/AsyncInputStream.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ class AsyncInputStream : public InputStream {
protected:
std::exception_ptr postponed_exception;

/**
* Notify both the synchronous caller and the InputStream handler.
*/
void InvokeOnAvailable() noexcept {
caller_cond.notify_one();
InputStream::InvokeOnAvailable();
}

public:
AsyncInputStream(EventLoop &event_loop, std::string_view _url,
Mutex &_mutex,
Expand Down
1 change: 1 addition & 0 deletions src/input/plugins/AlsaInputPlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ try {
CommitWriteBuffer(nbytes);
}
catch (...) {
const std::lock_guard protect{mutex};
postponed_exception = std::current_exception();
InvokeOnAvailable();
}
Expand Down
2 changes: 1 addition & 1 deletion src/playlist/Length.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void
playlist_provider_length(Response &r,
const SongLoader &loader,
const std::string_view uri,
SongEnumerator &e) noexcept
SongEnumerator &e)
{
const auto base_uri = PathTraitsUTF8::GetParent(uri);

Expand Down
4 changes: 2 additions & 2 deletions src/playlist/Print.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ playlist_provider_print(Response &r,
SongEnumerator &e,
unsigned start_index,
unsigned end_index,
bool detail) noexcept
bool detail)
{
const auto base_uri = PathTraitsUTF8::GetParent(uri);

Expand Down Expand Up @@ -59,7 +59,7 @@ playlist_provider_search_print(Response &r,
SongEnumerator &e,
unsigned start_index,
unsigned end_index,
SongFilter *filter) noexcept
SongFilter *filter)
{
const auto base_uri = PathTraitsUTF8::GetParent(uri);

Expand Down
Loading