diff --git a/packages/audioplayers_linux/linux/audio_player.cc b/packages/audioplayers_linux/linux/audio_player.cc index 72a86b0b6..9f7ee9453 100644 --- a/packages/audioplayers_linux/linux/audio_player.cc +++ b/packages/audioplayers_linux/linux/audio_player.cc @@ -144,7 +144,8 @@ void AudioPlayer::OnMediaError(GError* error, gchar* debug) { ", Code: " + std::to_string(error->code) + ")"; FlValue* details = fl_value_new_string(detailsStr.c_str()); // https://gstreamer.freedesktop.org/documentation/gstreamer/gsterror.html#enumerations - if (error->domain == GST_STREAM_ERROR) { + if (error->domain == GST_STREAM_ERROR || + error->domain == GST_RESOURCE_ERROR) { message = "Failed to set source. For troubleshooting, " "see: " STR_LINK_TROUBLESHOOTING; @@ -185,17 +186,12 @@ void AudioPlayer::OnMediaStateChange(GstObject* src, GstStateChangeReturn ret = gst_element_set_state(playbin, GST_STATE_PAUSED); if (ret == GST_STATE_CHANGE_FAILURE) { + // Only use [OnLog] as error is handled via [OnMediaError]. gchar const* errorDescription = + "OnMediaStateChange -> GST_STATE_CHANGE_FAILURE:" "Unable to set the pipeline from GST_STATE_READY to " "GST_STATE_PAUSED."; - if (this->_isInitialized) { - this->OnError("LinuxAudioError", errorDescription, nullptr, nullptr); - } else { - this->OnError("LinuxAudioError", - "Failed to set source. For troubleshooting, " - "see: " STR_LINK_TROUBLESHOOTING, - fl_value_new_string(errorDescription), nullptr); - } + this->OnLog(errorDescription); } if (this->_isInitialized) { this->_isInitialized = false;