Commit 86f1d76d authored by Julius Künzel's avatar Julius Künzel
Browse files

Fix noise when setting producer (e.g. when opening a project)

BUG: 433847
parent 226c550b
......@@ -654,9 +654,9 @@ bool GLWidget::isReady() const
return m_consumer != nullptr;
}
void GLWidget::requestSeek(int position)
void GLWidget::requestSeek(int position, bool noAudioScrub)
{
if(KdenliveSettings::audio_scrub()){
if(KdenliveSettings::audio_scrub() && !noAudioScrub){
m_consumer->set("scrub_audio", 1);
} else {
m_consumer->set("scrub_audio", 0);
......@@ -953,7 +953,7 @@ int GLWidget::setProducer(const std::shared_ptr<Mlt::Producer> &producer, bool i
m_proxy->resetPosition();
}
m_consumer->set("scrub_audio", 0);
m_proxy->setPosition(position > 0 ? position : m_producer->position());
m_proxy->setPositionAdvanced(position > 0 ? position : m_producer->position(), true);
return error;
}
......
......@@ -152,7 +152,7 @@ protected:
QString frameToTime(int frames) const;
public slots:
void requestSeek(int position);
void requestSeek(int position, bool noAudioScrub = false);
void setZoom(float zoom);
void setOffsetX(int x, int max);
void setOffsetY(int y, int max);
......
......@@ -2369,7 +2369,7 @@ void Monitor::panView(QPoint diff)
}
}
void Monitor::processSeek(int pos)
void Monitor::processSeek(int pos, bool noAudioScrub)
{
if (!slotActivateMonitor()) {
return;
......@@ -2377,7 +2377,8 @@ void Monitor::processSeek(int pos)
if (KdenliveSettings::pauseonseek()) {
pause();
}
m_glMonitor->requestSeek(pos);
//noAudioScrub = noAudioScrub || pCore->window()->getCurrentTimeline()->controller()->trimmingActive();
m_glMonitor->requestSeek(pos, noAudioScrub);
emit m_monitorManager->cleanMixer();
}
......
......@@ -269,7 +269,7 @@ private slots:
void addSnapPoint(int pos);
void removeSnapPoint(int pos);
/** @brief Process seek and optionally pause monitor */
void processSeek(int pos);
void processSeek(int pos, bool noAudioScrub = false);
/** @brief Check and display dropped frames */
void checkDrops();
/** @brief En/Disable the show record timecode feature in clip monitor */
......
......@@ -87,12 +87,17 @@ void MonitorProxy::setOverlayType(int ix)
}
bool MonitorProxy::setPosition(int pos)
{
return setPositionAdvanced(pos, false);
}
bool MonitorProxy::setPositionAdvanced(int pos, bool noAudioScrub)
{
if (m_position == pos) {
return true;
}
m_position = pos;
emit requestSeek(pos);
emit requestSeek(pos, noAudioScrub);
if (m_seekFinished) {
m_seekFinished = false;
emit seekFinishedChanged();
......
......@@ -81,6 +81,7 @@ public:
* */
int getPosition() const;
Q_INVOKABLE bool setPosition(int pos);
bool setPositionAdvanced(int pos, bool noAudioScrub);
Q_INVOKABLE void seek(int delta, uint modifiers);
Q_INVOKABLE QColor thumbColor1() const;
Q_INVOKABLE QColor thumbColor2() const;
......@@ -122,7 +123,7 @@ public:
signals:
void positionChanged(int);
void seekFinishedChanged();
void requestSeek(int pos);
void requestSeek(int pos, bool noAudioScrub);
void zoneChanged();
void saveZone(const QPoint zone);
void saveZoneWithUndo(const QPoint, const QPoint&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment