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

Fix error in project duration.

Fixes #1477
parent 1d451a31
Pipeline #195622 passed with stage
in 6 minutes and 9 seconds
......@@ -4580,12 +4580,24 @@ int TimelineModel::duration() const
int duration = 0;
auto it = m_allTracks.cbegin();
while (it != m_allTracks.cend()) {
if (!(*it)->isHidden()) {
int trackDuration = (*it)->getTrackService()->get_playtime();
duration = qMax(duration, trackDuration);
if ((*it)->isAudioTrack()) {
if ((*it)->isMute()) {
// Muted audio track
++it;
continue;
}
} else if ((*it)->isHidden()) {
// Hidden video track
++it;
continue;
}
int trackDuration = (*it)->getTrackService()->get_playtime();
duration = qMax(duration, trackDuration);
++it;
}
if (m_subtitleModel && !m_subtitleModel->isDisabled()) {
duration = qMax(duration, m_subtitleModel->trackDuration());
}
return duration;
}
......
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