m_mltConsumer->set("refresh", 1);
}
+
+void Render::mltPasteEffects(Mlt::Producer *source, Mlt::Producer *dest)
+{
+ Mlt::Service sourceService(source->get_service());
+ Mlt::Service destService(dest->get_service());
+
+ // move all effects to the correct producer
+ int ct = 0;
+ Mlt::Filter *filter = sourceService.filter(ct);
+ while (filter) {
+ if (filter->get("kdenlive_ix") != 0) {
+ sourceService.detach(*filter);
+ destService.attach(*filter);
+ } else ct++;
+ filter = sourceService.filter(ct);
+ }
+}
+
int Render::mltChangeClipSpeed(ItemInfo info, double speed, double oldspeed, Mlt::Producer *prod)
{
m_isBlocked = true;
delete clip;
return -1;
}
- delete clip;
+
QString serv = clipparent.get("mlt_service");
QString id = clipparent.get("id");
//kDebug() << "CLIP SERVICE: " << serv;
GenTime maxLength = GenTime(blankEnd, m_fps) - info.startPos;
cut = slowprod->cut((int)(info.cropStart.frames(m_fps) / speed), (int)(info.cropStart.frames(m_fps) / speed + maxLength.frames(m_fps) - 1));
} else cut = slowprod->cut((int)(info.cropStart.frames(m_fps) / speed), (int)((info.cropStart.frames(m_fps) + clipLength) / speed - 1));
+
+ // move all effects to the correct producer
+ mltPasteEffects(clip, cut);
+
trackPlaylist.insert_at(startPos, *cut, 1);
clipIndex = trackPlaylist.get_clip_index_at(startPos);
newLength = trackPlaylist.clip_length(clipIndex);
GenTime maxLength = GenTime(blankEnd, m_fps) - info.startPos;
cut = prod->cut((int)(info.cropStart.frames(m_fps)), (int)(info.cropStart.frames(m_fps) + maxLength.frames(m_fps) - 1));
} else cut = prod->cut((int)(info.cropStart.frames(m_fps)), (int)((info.cropStart + newDuration).frames(m_fps)) - 1);
+
+ // move all effects to the correct producer
+ mltPasteEffects(clip, cut);
+
trackPlaylist.insert_at(startPos, *cut, 1);
clipIndex = trackPlaylist.get_clip_index_at(startPos);
newLength = trackPlaylist.clip_length(clipIndex);
cut = slowprod->cut((int)(info.cropStart.frames(m_fps) / speed), (int)(info.cropStart.frames(m_fps) / speed + maxLength.frames(m_fps) - 1));
} else cut = slowprod->cut((int)(info.cropStart.frames(m_fps) / speed), (int)((info.cropStart / speed + newDuration).frames(m_fps) - 1));
+ // move all effects to the correct producer
+ mltPasteEffects(clip, cut);
+
trackPlaylist.insert_at(startPos, *cut, 1);
clipIndex = trackPlaylist.get_clip_index_at(startPos);
newLength = trackPlaylist.clip_length(clipIndex);
mlt_service_unlock(service.get_service());
}
+
+ delete clip;
if (clipIndex + 1 == trackPlaylist.count()) mltCheckLength();
m_isBlocked = false;
return newLength;
Mlt::Producer *clip = prod->cut(clipProducer.get_in(), clipProducer.get_out());
// move all effects to the correct producer
- Mlt::Service clipService(clipProducer.get_service());
- Mlt::Service newClipService(clip->get_service());
-
- int ct = 0;
- Mlt::Filter *filter = clipService.filter(ct);
- while (filter) {
- if (filter->get("kdenlive_ix") != 0) {
- clipService.detach(*filter);
- newClipService.attach(*filter);
- } else ct++;
- filter = clipService.filter(ct);
- }
+ mltPasteEffects(&clipProducer, clip);
trackPlaylist.insert_at(pos, clip, 1);
mlt_service_unlock(m_mltConsumer->get_service());
}
// move all effects to the correct producer
- Mlt::Service clipService(clipProducer.get_service());
- Mlt::Service newClipService(clip->get_service());
-
- int ct = 0;
- Mlt::Filter *filter = clipService.filter(ct);
- while (filter) {
- if (filter->get("kdenlive_ix") != 0) {
- clipService.detach(*filter);
- newClipService.attach(*filter);
- } else ct++;
- filter = clipService.filter(ct);
- }
+ mltPasteEffects(&clipProducer, clip);
int newIndex = destTrackPlaylist.insert_at(moveEnd, clip, 1);
destTrackPlaylist.consolidate_blanks(0);