Commit 770227ce authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix bug and warning calculating available mix duration when no frame is available

parent 95473398
Pipeline #192852 failed with stage
in 1 minute and 31 seconds
......@@ -226,8 +226,8 @@ private:
void prepareRendering(bool delayedRendering);
/** @brief Create a new empty playlist (*.mlt) file and @returns the filename of the created file */
QString generatePlaylistFile(bool delayedRendering);
void generateRenderFiles(QDomDocument doc, int in, int out, QString outputFile, bool delayedRendering);
RenderJobItem *createRenderJob(const QString &playlist, const QString &outputFile, int in, int out);
void generateRenderFiles(QDomDocument doc, int in, int out, QString outputFile, bool delayedRendering, const QString &subtitleFile = QString());
RenderJobItem *createRenderJob(const QString &playlist, const QString &outputFile, int in, int out, const QString &subtitleFile = QString());
signals:
void abortProcess(const QString &url);
......
......@@ -941,9 +941,12 @@ bool TimelineModel::mixClip(int idToMove, const QString &mixId, int delta)
}
// Make sure we have enough space in clip to resize
// leftMax is the maximum frames we have to expand first clip on the right
leftMax = m_allClips[s]->getPlaytime();
leftMax = m_allClips[previousClip]->m_endlessResize
? m_allClips[s]->getPlaytime()
: qMin(m_allClips[s]->getPlaytime(), m_allClips[previousClip]->getMaxDuration() - m_allClips[previousClip]->getOut() - 1);
// rightMax is the maximum frames we have to expand second clip on the left
rightMax = m_allClips[previousClip]->getPlaytime();
rightMax = m_allClips[s]->m_endlessResize ? m_allClips[previousClip]->getPlaytime()
: qMin(m_allClips[previousClip]->getPlaytime(), m_allClips[s]->getIn());
if (getTrackById_const(selectedTrack)->hasStartMix(previousClip)) {
int spaceBeforeMix = m_allClips[s]->getPosition() - (m_allClips[previousClip]->getPosition() + m_allClips[previousClip]->getMixDuration());
rightMax = rightMax == -1 ? spaceBeforeMix : qMin(rightMax, spaceBeforeMix);
......@@ -968,9 +971,10 @@ bool TimelineModel::mixClip(int idToMove, const QString &mixId, int delta)
// Mix at end of selected clip
// Make sure we have enough space in clip to resize
// leftMax is the maximum frames we have to expand first clip on the right
leftMax = m_allClips[nextClip]->getPlaytime();
leftMax = m_allClips[s]->m_endlessResize ? m_allClips[nextClip]->getPlaytime()
: qMin(m_allClips[nextClip]->getPlaytime(), m_allClips[s]->getMaxDuration() - m_allClips[s]->getOut() - 1);
// rightMax is the maximum frames we have to expand second clip on the left
rightMax = m_allClips[s]->getPlaytime();
rightMax = m_allClips[nextClip]->m_endlessResize ? m_allClips[s]->getPlaytime() : qMin(m_allClips[s]->getPlaytime(), m_allClips[nextClip]->getIn());
if (getTrackById_const(selectedTrack)->hasStartMix(s)) {
int spaceBeforeMix = m_allClips[nextClip]->getPosition() - (m_allClips[s]->getPosition() + m_allClips[s]->getMixDuration());
rightMax = rightMax == -1 ? spaceBeforeMix : qMin(rightMax, spaceBeforeMix);
......
Supports Markdown
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