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

Merge branch 'Applications/15.08' of git://anongit.kde.org/kdenlive into 15.08

parents c5bc0591 5c1662ac
...@@ -2238,8 +2238,6 @@ void Bin::slotLoadClipMarkers(const QString &id) ...@@ -2238,8 +2238,6 @@ void Bin::slotLoadClipMarkers(const QString &id)
} }
} }
if (!markersList.isEmpty()) slotAddClipMarker(id, markersList, command); if (!markersList.isEmpty()) slotAddClipMarker(id, markersList, command);
if (command->childCount() > 0) m_doc->commandStack()->push(command);
else delete command;
} }
void Bin::slotSaveClipMarkers(const QString &id) void Bin::slotSaveClipMarkers(const QString &id)
......
...@@ -827,6 +827,7 @@ void ProjectClip::slotCreateAudioThumbs() ...@@ -827,6 +827,7 @@ void ProjectClip::slotCreateAudioThumbs()
Mlt::Producer *audioProducer = new Mlt::Producer(*prod->profile(), service.toUtf8().constData(), prod->get("resource")); Mlt::Producer *audioProducer = new Mlt::Producer(*prod->profile(), service.toUtf8().constData(), prod->get("resource"));
if (!audioProducer->is_valid()) { if (!audioProducer->is_valid()) {
delete audioProducer; delete audioProducer;
delete audioLevels;
return; return;
} }
Mlt::Filter chans(*prod->profile(), "audiochannels"); Mlt::Filter chans(*prod->profile(), "audiochannels");
......
...@@ -1018,8 +1018,8 @@ void Monitor::slotLoopClip() ...@@ -1018,8 +1018,8 @@ void Monitor::slotLoopClip()
void Monitor::updateClipProducer(Mlt::Producer *prod) void Monitor::updateClipProducer(Mlt::Producer *prod)
{ {
if (render == NULL) return; if (render == NULL) return;
render->setProducer(prod, -1, false); if (render->setProducer(prod, -1, false))
if (prod) prod->set_speed(1.0); prod->set_speed(1.0);
} }
void Monitor::updateClipProducer(const QString &playlist) void Monitor::updateClipProducer(const QString &playlist)
...@@ -1469,9 +1469,10 @@ void Monitor::slotSwitchRec(bool enable) ...@@ -1469,9 +1469,10 @@ void Monitor::slotSwitchRec(bool enable)
bool Monitor::startCapture(const QString &params, const QString &path, Mlt::Producer *p) bool Monitor::startCapture(const QString &params, const QString &path, Mlt::Producer *p)
{ {
m_controller = NULL; m_controller = NULL;
render->updateProducer(p); if (render->updateProducer(p)) {
m_glMonitor->reconfigureMulti(params, path, p->profile()); m_glMonitor->reconfigureMulti(params, path, p->profile());
return true; return true;
} else return false;
} }
bool Monitor::stopCapture() bool Monitor::stopCapture()
......
...@@ -1041,7 +1041,7 @@ void Render::loadUrl(const QString &url) ...@@ -1041,7 +1041,7 @@ void Render::loadUrl(const QString &url)
setProducer(producer, 0, true); setProducer(producer, 0, true);
} }
int Render::updateProducer(Mlt::Producer *producer) bool Render::updateProducer(Mlt::Producer *producer)
{ {
if (m_mltProducer) { if (m_mltProducer) {
if (strcmp(m_mltProducer->get("resource"), "<tractor>") == 0) { if (strcmp(m_mltProducer->get("resource"), "<tractor>") == 0) {
...@@ -1060,10 +1060,7 @@ int Render::updateProducer(Mlt::Producer *producer) ...@@ -1060,10 +1060,7 @@ int Render::updateProducer(Mlt::Producer *producer)
} }
} }
if (!producer || !producer->is_valid()) { if (!producer || !producer->is_valid()) {
if (producer) delete producer; return false;
producer = m_blackClip->cut(0, 1);
producer->set("id", "black");
return -1;
} }
m_fps = producer->get_fps(); m_fps = producer->get_fps();
m_mltProducer = producer; m_mltProducer = producer;
...@@ -1071,10 +1068,10 @@ int Render::updateProducer(Mlt::Producer *producer) ...@@ -1071,10 +1068,10 @@ int Render::updateProducer(Mlt::Producer *producer)
m_qmlView->setProducer(producer, false); m_qmlView->setProducer(producer, false);
m_mltConsumer = m_qmlView->consumer(); m_mltConsumer = m_qmlView->consumer();
} }
return 0; return true;
} }
int Render::setProducer(Mlt::Producer *producer, int position, bool isActive) bool Render::setProducer(Mlt::Producer *producer, int position, bool isActive)
{ {
m_refreshTimer.stop(); m_refreshTimer.stop();
requestedSeekPosition = SEEK_INACTIVE; requestedSeekPosition = SEEK_INACTIVE;
...@@ -1104,13 +1101,8 @@ int Render::setProducer(Mlt::Producer *producer, int position, bool isActive) ...@@ -1104,13 +1101,8 @@ int Render::setProducer(Mlt::Producer *producer, int position, bool isActive)
} }
blockSignals(true); blockSignals(true);
if (!producer || !producer->is_valid()) { if (!producer || !producer->is_valid()) {
if (producer) delete producer; qWarning() << "Invalid playlist";
producer = m_blackClip->cut(0, 1); return false;
producer->set("id", "black");
}
if (!producer || !producer->is_valid()) {
qDebug() << " WARNING - - - - -INVALID PLAYLIST: ";
return -1;
} }
emit stopped(); emit stopped();
...@@ -1133,7 +1125,7 @@ int Render::setProducer(Mlt::Producer *producer, int position, bool isActive) ...@@ -1133,7 +1125,7 @@ int Render::setProducer(Mlt::Producer *producer, int position, bool isActive)
emit durationChanged(m_mltProducer->get_playtime(), m_mltProducer->get_in()); emit durationChanged(m_mltProducer->get_playtime(), m_mltProducer->get_in());
position = m_mltProducer->position(); position = m_mltProducer->position();
emit rendererPosition(position); emit rendererPosition(position);
return 0; return true;
} }
void Render::startConsumer() { void Render::startConsumer() {
......
...@@ -125,8 +125,8 @@ class Render: public AbstractRender ...@@ -125,8 +125,8 @@ class Render: public AbstractRender
* *
* Creates the producer from the text playlist. */ * Creates the producer from the text playlist. */
int setSceneList(QString playlist, int position = 0); int setSceneList(QString playlist, int position = 0);
int updateProducer(Mlt::Producer *producer); bool updateProducer(Mlt::Producer *producer);
int setProducer(Mlt::Producer *producer, int position, bool isActive); bool setProducer(Mlt::Producer *producer, int position, bool isActive);
/** @brief Get the current MLT producer playlist. /** @brief Get the current MLT producer playlist.
* @return A string describing the playlist */ * @return A string describing the playlist */
......
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