[gnome-music] Print URI and message if error occurred
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Print URI and message if error occurred
- Date: Thu, 4 Apr 2013 11:46:42 +0000 (UTC)
commit b65f561719ee28d586fd5d5adfb7920fb892d2ef
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Thu Apr 4 13:37:10 2013 +0200
Print URI and message if error occurred
src/player.js | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 71c1745..2999e03 100644
--- a/src/player.js
+++ b/src/player.js
@@ -55,7 +55,16 @@ const Player = new Lang.Class({
Gst.init(null, 0);
this.player = Gst.ElementFactory.make("playbin", "player");
this.bus = this.player.get_bus();
- this.msg = this.bus.timed_pop_filtered (Gst.Clock.TIME_NONE, Gst.Message.ERROR | Gst.Message.EOS);
+ this.bus.add_signal_watch()
+ this.bus.connect("message", Lang.bind(this,
+ function(bus, message) {
+ if (message.type == Gst.MessageType.ERROR) {
+ let uri = this.playlist[this.currentTrack].get_url();
+ log("URI:" + uri);
+ log("Error:" + message.parse_error());
+ this.stop();
+ }
+ }));
this._setup_view();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]