mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-19 04:00:40 +01:00
GstEngine: Call SetState right before setFuture
This commit is contained in:
parent
171dc84df1
commit
6768f614c7
@ -235,13 +235,14 @@ bool GstEngine::Play(const quint64 offset_nanosec) {
|
|||||||
|
|
||||||
if (!current_pipeline_ || current_pipeline_->is_buffering()) return false;
|
if (!current_pipeline_ || current_pipeline_->is_buffering()) return false;
|
||||||
|
|
||||||
QFuture<GstStateChangeReturn> future = current_pipeline_->SetState(GST_STATE_PLAYING);
|
|
||||||
QFutureWatcher<GstStateChangeReturn> *watcher = new QFutureWatcher<GstStateChangeReturn>();
|
QFutureWatcher<GstStateChangeReturn> *watcher = new QFutureWatcher<GstStateChangeReturn>();
|
||||||
int pipeline_id = current_pipeline_->id();
|
const int pipeline_id = current_pipeline_->id();
|
||||||
QObject::connect(watcher, &QFutureWatcher<GstStateChangeReturn>::finished, this, [this, watcher, offset_nanosec, pipeline_id]() {
|
QObject::connect(watcher, &QFutureWatcher<GstStateChangeReturn>::finished, this, [this, watcher, pipeline_id, offset_nanosec]() {
|
||||||
PlayDone(watcher->result(), offset_nanosec, pipeline_id);
|
const GstStateChangeReturn ret = watcher->result();
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
|
PlayDone(ret, offset_nanosec, pipeline_id);
|
||||||
});
|
});
|
||||||
|
QFuture<GstStateChangeReturn> future = current_pipeline_->SetState(GST_STATE_PLAYING);
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
|
|
||||||
if (is_fading_out_to_pause_) {
|
if (is_fading_out_to_pause_) {
|
||||||
|
Loading…
Reference in New Issue
Block a user