Fix cannot pause near end of clip regression

CCBUG: 353099
parent 6a0feae9
......@@ -1773,6 +1773,7 @@ void MainWindow::connectDocument()
connect(trackView->projectView(), SIGNAL(showClipFrame(const QString&,int)), pCore->bin(), SLOT(selectClipById(const QString&,int)));
connect(trackView->projectView(), SIGNAL(playMonitor()), m_projectMonitor, SLOT(slotPlay()));
connect(trackView->projectView(), SIGNAL(pauseMonitor()), m_projectMonitor, SLOT(pause()), Qt::DirectConnection);
connect(m_projectMonitor, &Monitor::addEffect, trackView->projectView(), &CustomTrackView::slotAddEffectToCurrentItem);
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*,int,QPoint,bool)), m_projectMonitor, SLOT(slotSetSelectedClip(Transition*)));
......
......@@ -1190,7 +1190,7 @@ void Monitor::refreshMonitorIfActive()
void Monitor::pause()
{
if (render == NULL) return;
if (!m_playAction->isActive() || render == NULL) return;
slotActivateMonitor();
render->switchPlay(false);
m_playAction->setActive(false);
......
......@@ -91,7 +91,6 @@ public:
AbstractRender *abstractRender();
void resetProfile(MltVideoProfile profile);
void setCustomProfile(const QString &profile, const Timecode &tc);
void pause();
void setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL, QAction *loopClip = NULL);
const QString sceneList();
const QString activeClipId();
......@@ -280,6 +279,7 @@ public slots:
void start();
void switchPlay(bool play);
void slotPlay();
void pause();
void slotPlayZone();
void slotLoopZone();
/** @brief Loops the selected item (clip or transition). */
......
......@@ -732,7 +732,7 @@ void Render::switchPlay(bool play, double speed)
m_mltConsumer->purge();
}
m_mltProducer->set_speed(speed);
} else if (m_mltProducer->get_speed() != 0) {
} else {
m_mltConsumer->purge();
m_mltProducer->set_speed(0.0);
m_mltConsumer->set("buffer", 0);
......
......@@ -615,7 +615,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
} else if (m_moveOpMode == RollingStart || m_moveOpMode == RollingEnd) {
m_toolManagers.value(TrimType)->mouseMove(snappedPos);
} else if (m_moveOpMode == ResizeStart || m_moveOpMode == ResizeEnd) {
m_document->renderer()->switchPlay(false);
emit pauseMonitor();
m_toolManagers.value(ResizeType)->mouseMove(snappedPos);
} else if (m_moveOpMode == FadeIn) {
static_cast<ClipItem*>(m_dragItem)->setFadeIn(static_cast<int>(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
......
......@@ -597,6 +597,7 @@ signals:
void updateClipMarkers(ClipController*);
void updateTrackHeaders();
void playMonitor();
void pauseMonitor();
/** @brief Monitor document changes (for example the presence of audio data in timeline for export widget.*/
void documentModified();
void showTrackEffects(int, TrackInfo);
......
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