summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--player/player.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/player/player.go b/player/player.go
index b3dc761..337d358 100644
--- a/player/player.go
+++ b/player/player.go
@@ -198,9 +198,7 @@ func (p *Player) onMessage(bus *gst.Bus, msg *gst.Message) {
p.updateChan <- updateData{duration: p.duration}
err, _ := msg.ParseError()
p.stdlog.Printf("GStreamer Pipeline Error: %s", err)
- case gst.MESSAGE_DURATION_CHANGED:
- fallthrough
- case gst.MESSAGE_ASYNC_DONE:
+ case gst.MESSAGE_DURATION_CHANGED, gst.MESSAGE_ASYNC_DONE:
duration, ok := p.pipe.QueryDuration(gst.FORMAT_TIME)
if ok {
p.duration = time.Duration(duration)
@@ -292,9 +290,7 @@ func (p *Player) pause() (resp pauseResult) {
func (p *Player) playPause() (resp playPauseResult) {
switch p.state {
- case IDLE:
- fallthrough
- case PAUSED:
+ case IDLE, PAUSED:
p.pipe.SetState(gst.STATE_PLAYING)
p.changeState(PLAYING)
case PLAYING:
@@ -309,9 +305,7 @@ func (p *Player) stop() (resp stopResult) {
case IDLE:
p.pipe.SetState(gst.STATE_NULL)
p.changeState(IDLE)
- case PLAYING:
- fallthrough
- case PAUSED:
+ case PLAYING, PAUSED:
p.pipe.SetState(gst.STATE_NULL)
p.pipe.SetState(gst.STATE_PAUSED)
p.changeState(PAUSED)
@@ -322,9 +316,7 @@ func (p *Player) stop() (resp stopResult) {
func (p *Player) seek(pos float64) (resp seekResult) {
postime := int64(float64(p.duration) * pos)
switch p.state {
- case PLAYING:
- fallthrough
- case PAUSED:
+ case PLAYING, PAUSED:
p.pipe.SeekSimple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH|gst.SEEK_FLAG_KEY_UNIT, postime)
}
return