HEAD
+ * Fix crash when deleting a track and having an audio clip on last track (http://kdenlive.org/mantis/view.php?id=2168)
* Check for duration mismatch in clip producers when opening a document (can cause corruption)
* Automatically create backups of the project file; they can be restored in a recovery dialog.
* Allow to manually edit video4linux capture profile.
clip->updateItem();
ItemInfo clipinfo = clip->info();
// We add a move clip command so that we get the correct producer for new track number
- if (clip->clipType() == AV || clip->clipType() == AUDIO) {
+ if (clip->clipType() == AV || clip->clipType() == AUDIO || clip->clipType() == PLAYLIST) {
Mlt::Producer *prod = clip->getProducer(clipinfo.track);
- if (!m_document->renderer()->mltUpdateClipProducer((int)(m_document->tracksCount() - clipinfo.track), clipinfo.startPos.frames(m_document->fps()), prod)) {
+ if (prod == NULL || !m_document->renderer()->mltUpdateClipProducer((int)(m_document->tracksCount() - clipinfo.track), clipinfo.startPos.frames(m_document->fps()), prod)) {
emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", clipinfo.startPos.frames(m_document->fps()), clipinfo.track), ErrorMessage);
}
}
// If we are in overwrite mode, always allow the move
return true;
}
- int height;
+ int height = m_tracksHeight - 2;
int offset = 0;
if (type == TRANSITIONWIDGET) {
height = Transition::itemHeight();
}
}
if (m_audioTrackProducers.at(track) == NULL) {
+ int i;
+ for (i = 0; i < m_audioTrackProducers.count(); i++)
+ if (m_audioTrackProducers.at(i) != NULL) break;
+ if (i < m_audioTrackProducers.count()) {
+ // Could not find a valid producer for that clip, check in
+ return m_audioTrackProducers.at(i);
+ }
+
Mlt::Producer *base = producer();
m_audioTrackProducers[track] = new Mlt::Producer(*(base->profile()), base->get("resource"));
if (m_properties.contains("force_aspect_num") && m_properties.contains("force_aspect_den") && m_properties.contains("frame_size"))
/*for (int i = 0; i < m_baseTrackProducers.count(); i++) {
if (m_baseTrackProducers.at(i)) kDebug() << "// PROD: " << i << ", ID: " << m_baseTrackProducers.at(i)->get("id");
}*/
- if (track == -1 || (m_clipType != AUDIO && m_clipType != AV)) {
+ if (track == -1 || (m_clipType != AUDIO && m_clipType != AV && m_clipType != PLAYLIST)) {
if (m_baseTrackProducers.count() == 0) return NULL;
for (int i = 0; i < m_baseTrackProducers.count(); i++) {
if (m_baseTrackProducers.at(i) != NULL)
for (i = 0; i < m_baseTrackProducers.count(); i++)
if (m_baseTrackProducers.at(i) != NULL) break;
- if (i >= m_baseTrackProducers.count()) return NULL;
+ if (i >= m_baseTrackProducers.count()) {
+ // Could not find a valid producer for that clip, check in
+ return NULL;
+ }
if (KIO::NetAccess::exists(KUrl(m_baseTrackProducers.at(i)->get("resource")), KIO::NetAccess::SourceSide, 0))
m_baseTrackProducers[track] = new Mlt::Producer(*m_baseTrackProducers.at(i)->profile(), m_baseTrackProducers.at(i)->get("resource"));