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

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