chill out with cpu usage
This commit is contained in:
parent
e1472ddf42
commit
1e13ef2454
1 changed files with 2 additions and 2 deletions
|
@ -55,13 +55,13 @@ class Playbin : Object {
|
||||||
//souphttpsrc.user_agent = "Wavelet/0.1.0 (Linux)"; // WAVELET_VERSION
|
//souphttpsrc.user_agent = "Wavelet/0.1.0 (Linux)"; // WAVELET_VERSION
|
||||||
|
|
||||||
// regularly update position
|
// regularly update position
|
||||||
Idle.add (() => {
|
Timeout.add (500, () => {
|
||||||
int64 new_position;
|
int64 new_position;
|
||||||
if (this.playbin.query_position (Gst.Format.TIME, out new_position)) {
|
if (this.playbin.query_position (Gst.Format.TIME, out new_position)) {
|
||||||
this.set_position (new_position < this.duration ? new_position : this.duration);
|
this.set_position (new_position < this.duration ? new_position : this.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rerun when idle
|
// keep rerunning
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue