Changed wait requirement for setting seekbar maximum value. GStreamer needs to load the file before we can know its duration and previously it might not wait long enough for that data to populate.
This commit is contained in:
parent
97f8e52a16
commit
ba951541b6
@ -73,7 +73,7 @@ class Player {
|
|||||||
playBin.play();
|
playBin.play();
|
||||||
thread.start();
|
thread.start();
|
||||||
while (true) {
|
while (true) {
|
||||||
if (playBin.isPlaying()) break;
|
if (playBin.queryDuration().getNanoSeconds() > 0) break;
|
||||||
} // Wait for song to actually be playing otherwise queryDuration is always zero
|
} // Wait for song to actually be playing otherwise queryDuration is always zero
|
||||||
callbackInterface.setSeekBarDuration((int) playBin.queryDuration().toSeconds());
|
callbackInterface.setSeekBarDuration((int) playBin.queryDuration().toSeconds());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user