diff --git a/client/player/wasapi_player.cpp b/client/player/wasapi_player.cpp index eedcb868..ffd6a1e9 100644 --- a/client/player/wasapi_player.cpp +++ b/client/player/wasapi_player.cpp @@ -230,7 +230,6 @@ void WASAPIPlayer::worker() hr = device->Activate(__uuidof(IAudioSessionManager), CLSCTX_INPROC_SERVER, NULL, (void**)&sessionManager); CHECK_HR(hr); - // Get the control interface for the process-specific audio // session with session GUID = GUID_NULL. This is the session @@ -348,7 +347,7 @@ void WASAPIPlayer::worker() volCorrection_ = audioEventListener_->getVolume(); // muteOverride = audioEventListener_->getMuted(); // use this for also applying audio mixer mute state } - + // get audio device volume from IAudioEndpointVolume // float deviceVolume = audioEndpointVolumeCallback.getVolume(); // system volume (for this audio device) // bool deviceMuted = audioEndpointVolumeCallback.getMuted(); // system mute (for this audio device) diff --git a/server/streamreader/airplay_stream.cpp b/server/streamreader/airplay_stream.cpp index 08af19f4..7763aea8 100644 --- a/server/streamreader/airplay_stream.cpp +++ b/server/streamreader/airplay_stream.cpp @@ -232,25 +232,17 @@ void AirplayStream::pipeReadLine() boost::asio::async_read_until(*pipe_fd_, streambuf_pipe_, delimiter, [this, delimiter](const std::error_code& ec, std::size_t bytes_transferred) { if (ec) { - if (ec.value() == boost::asio::error::eof) + if ((ec.value() == boost::asio::error::eof) || (ec.value() == boost::asio::error::bad_descriptor)) { // For some reason, EOF is returned until the first metadata is written to the pipe. - // Is this a boost bug? + // If shairport-sync has not finished setting up the pipe, bad file descriptor is returned. LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms" << "\n"; wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); }); } - if (ec.value() == boost::asio::error::bad_descriptor) - { - // If shairport-sync has not finished setting up the pipe, bad file descriptor is returned. - // retry in a few seconds - LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms" - << "\n"; - wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); }); - } else { - LOG(ERROR, LOG_TAG) << "Error while reading from metadata pipe: " << ec.message() << "\n"; + LOG(ERROR, LOG_TAG) << "Error while reading from metadata pipe: " << ec.message() << "\n"; } return; }