return NULL;
}
- if (execute) m_document->renderer()->mltCutClip(m_document->tracksCount() - info.track, cutTime);
+ if (execute) {
+ if (!m_document->renderer()->mltCutClip(m_document->tracksCount() - info.track, cutTime)) {
+ // Error cuting clip in playlist
+ m_blockRefresh = false;
+ return NULL;
+ }
+ }
int cutPos = (int) cutTime.frames(m_document->fps());
ItemInfo newPos;
newPos.startPos = cutTime;
}
-void Render::mltCutClip(int track, GenTime position)
+bool Render::mltCutClip(int track, GenTime position)
{
Mlt::Service service(m_mltProducer->parent().get_service());
if (service.type() != tractor_type) {
kWarning() << "// TRACTOR PROBLEM";
- return;
+ return false;
}
Mlt::Tractor tractor(service);
int clipIndex = trackPlaylist.get_clip_index_at(cutPos);
if (trackPlaylist.is_blank(clipIndex)) {
kDebug() << "// WARNING, TRYING TO CUT A BLANK";
- return;
+ return false;
}
service.lock();
int clipStart = trackPlaylist.clip_start(clipIndex);
// duplicate effects
Mlt::Producer *original = trackPlaylist.get_clip_at(clipStart);
Mlt::Producer *clip = trackPlaylist.get_clip_at(cutPos);
+
+ if (original == NULL || clip == NULL) {
+ kDebug() << "// ERROR GRABBING CLIP AFTER SPLIT";
+ return false;
+ }
- Mlt::Service clipService;
- Mlt::Service dupService;
- if (original)
- clipService = Mlt::Service(original->get_service());
- else
- clipService = Mlt::Service();
-
- if (clip)
- dupService = Mlt::Service(clip->get_service());
- else
- dupService = Mlt::Service();
+ Mlt::Service clipService(original->get_service());
+ Mlt::Service dupService(clip->get_service());
- if (original == NULL || clip == NULL)
- kDebug() << "// ERROR GRABBING CLIP AFTER SPLIT";
delete original;
delete clip;
ct++;
filter = clipService.filter(ct);
}
-
+ return true;
/* // Display playlist info
kDebug()<<"//////////// AFTER";
for (int i = 0; i < trackPlaylist.count(); i++) {
return true;
}
+
+
#include "renderer.moc"
Mlt::Producer *checkSlowMotionProducer(Mlt::Producer *prod, QDomElement element);
int mltInsertClip(ItemInfo info, QDomElement element, Mlt::Producer *prod, bool overwrite = false, bool push = false);
bool mltUpdateClip(Mlt::Tractor *tractor, ItemInfo info, QDomElement element, Mlt::Producer *prod);
- void mltCutClip(int track, GenTime position);
+ bool mltCutClip(int track, GenTime position);
void mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int> trackTransitionStartList, int track, const GenTime &duration, const GenTime &timeOffset);
int mltGetSpaceLength(const GenTime &pos, int track, bool fromBlankStart);