diff options
-rw-r--r-- | player/player.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/player/player.go b/player/player.go index 60a19fa..131ef58 100644 --- a/player/player.go +++ b/player/player.go @@ -100,27 +100,30 @@ func (p *Player) onMessage(bus *gst.Bus, msg *gst.Message) { case gst.MESSAGE_EOS: p.pipe.SetState(gst.STATE_NULL) p.state = IDLE - p.stdlog.Printf("GStreamer Pipeline: EOS reached!\n") + p.stdlog.Printf("GStreamer Pipeline: EOS reached!") case gst.MESSAGE_WARNING: warn, _ := msg.ParseWarning() - p.stdlog.Printf("GStreamer Pipeline Warning: %s\n", warn) + p.stdlog.Printf("GStreamer Pipeline Warning: %s", warn) case gst.MESSAGE_ERROR: p.pipe.SetState(gst.STATE_NULL) p.state = IDLE err, _ := msg.ParseError() - p.stdlog.Printf("GStreamer Pipeline Error: %s\n", err) + p.stdlog.Printf("GStreamer Pipeline Error: %s", err) case gst.MESSAGE_ASYNC_DONE: len, ok := p.pipe.QueryDuration(gst.FORMAT_TIME) if ok { - p.stdlog.Printf("GStreamer Pipeline: loaded file has length: %d.%d s\n", len/1000000000, len%1000000000) + p.stdlog.Printf("GStreamer Pipeline: loaded file has length: %d.%d s", len/1000000000, len%1000000000) } else { - p.stdlog.Printf("GStreamer Pipeline Error: unable to query duration of file\n") + p.stdlog.Printf("GStreamer Pipeline Error: unable to query duration of file") } case gst.MESSAGE_ELEMENT: - p.stdlog.Printf("GStreamer Message: from element '%s'\n", msg.GetSourceName()) + src := msg.GetSourceName() + p.stdlog.Printf("GStreamer Message: from element '%s'", src) + s := msg.GetStructure() + p.stdlog.Printf(">>> %s(%s): peak: %v, decay: %v", src, s.Name, s.Data["peak"], s.Data["decay"]) case gst.MESSAGE_STATE_CHANGED: default: - p.stdlog.Printf("GStreamer Message: unknown type '%s'\n", msg.GetTypeName()) + p.stdlog.Printf("GStreamer Message: unknown type '%s'", msg.GetTypeName()) } } |