Skip to content

Instantly share code, notes, and snippets.

@theirix
Created September 15, 2018 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theirix/98bd244e8837bfb3bdc0ac97221703fc to your computer and use it in GitHub Desktop.
Save theirix/98bd244e8837bfb3bdc0ac97221703fc to your computer and use it in GitHub Desktop.
cantata-dumpPlayer.patch
diff --git a/mpd-interface/httpstream.cpp b/mpd-interface/httpstream.cpp
index a8b9cc0e..27cdfbe2 100644
--- a/mpd-interface/httpstream.cpp
+++ b/mpd-interface/httpstream.cpp
@@ -288,4 +288,22 @@ void HttpStream::stopTimer()
playStateChecks=0;
}
+void HttpStream::dumpPlayer()
+{
+#ifndef LIBVLC_FOUND
+ if (player)
+ {
+ DBUG << " player state" << player->state()
+ << " media status" << player->mediaStatus()
+ << " media" << player->media().canonicalUrl();
+ if (player->error() != QMediaPlayer::NoError)
+ {
+ DBUG << " player error code " << player->error()
+ << ":" << player->errorString();
+ }
+ }
+#endif
+}
+
+
#include "moc_httpstream.cpp"
diff --git a/mpd-interface/httpstream.h b/mpd-interface/httpstream.h
index 914b7425..c79ab178 100644
--- a/mpd-interface/httpstream.h
+++ b/mpd-interface/httpstream.h
@@ -67,6 +67,8 @@ private:
void startTimer();
void stopTimer();
+ void dumpPlayer();
+
private:
bool enabled;
bool muted;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment