Commit b651a4de authored by Simon Eugster's avatar Simon Eugster

Fix crash when insert zone has no audio track

Closes #694
parent fb05e738
Pipeline #21210 passed with stage
in 16 minutes and 1 second
......@@ -2159,22 +2159,13 @@ int TimelineController::insertZone(const QString &binId, QPoint zone, bool overw
std::shared_ptr<ProjectClip> clip = pCore->bin()->getBinClip(binId);
int aTrack = -1;
int vTrack = -1;
if (clip->hasAudio()) {
if (clip->hasAudio() && !m_model->m_audioTarget.isEmpty()) {
aTrack = m_model->m_audioTarget.firstKey();
}
if (clip->hasVideo()) {
vTrack = videoTarget();
}
/*if (aTrack == -1 && vTrack == -1) {
// No target tracks defined, use active track
if (m_model->getTrackById_const(m_activeTrack)->isAudioTrack()) {
aTrack = m_activeTrack;
vTrack = m_model->getMirrorVideoTrackId(aTrack);
} else {
vTrack = m_activeTrack;
aTrack = m_model->getMirrorAudioTrackId(vTrack);
}
}*/
int insertPoint;
QPoint sourceZone;
if (useRuler() && m_zone != 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