fix end of stream lol
This commit is contained in:
parent
af127b8d7b
commit
5c24cde637
1 changed files with 7 additions and 3 deletions
|
@ -148,6 +148,11 @@ public class Playbin : GLib.Object {
|
|||
} else {
|
||||
this.inc_position = true;
|
||||
}
|
||||
|
||||
// estimate duration from api data
|
||||
// while mpv doesn't know it
|
||||
this.duration = ((Subsonic.Song) this._play_queue.get_item (this.play_queue_position)).duration;
|
||||
|
||||
this.new_track ();
|
||||
break;
|
||||
|
||||
|
@ -158,10 +163,9 @@ public class Playbin : GLib.Object {
|
|||
warning ("playback of track aborted: %s", data.error.to_string ());
|
||||
}
|
||||
|
||||
if (this.inc_position) {
|
||||
// reached the end
|
||||
if (this.inc_position && this.play_queue_position+1 == this._play_queue.get_n_items ()) {
|
||||
// reached the end (?)
|
||||
this.play_queue_position += 1;
|
||||
assert (this.play_queue_position == this._play_queue.get_n_items ());
|
||||
this.state = PlaybinState.STOPPED;
|
||||
this.stopped ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue