kutils: change the slider position before load() in KMediaWidget::open()

fixes rare runtime warning about seek command failure. the proper thing
to do is close, wait for close to happen, set slider position, load and
continue the event cycle but that's too complicated when buffering is not
expected to happen on seek (i.e. when a file from the hard-disk is
currently loaded)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-14 22:07:51 +02:00
parent b38a3f8b41
commit 589c3ca009

View file

@ -162,8 +162,8 @@ void KMediaWidget::open(const QString &path)
d->m_volumeline.setFrameRange(0, d->m_ui->w_volume->value()); d->m_volumeline.setFrameRange(0, d->m_ui->w_volume->value());
setVolume(0); setVolume(0);
} }
d->m_player->load(path);
d->m_ui->w_position->setSliderPosition(0); // fake seek to start d->m_ui->w_position->setSliderPosition(0); // fake seek to start
d->m_player->load(path);
if (d->m_smoothvolume) { if (d->m_smoothvolume) {
d->m_volumeline.start(); d->m_volumeline.start();
} }