From: Ed R. <ed....@go...> - 2013-02-13 18:40:20
|
Git commit f3efa339af9453f00f2305821d68ba0c775ede76 by Ed Rogalsky. Committed on 13/02/2013 at 19:39. Pushed by rogalsky into branch 'feature/jack'. fix concurrency crash in opengl mode M +37 -23 src/renderer.cpp http://commits.kde.org/kdenlive/f3efa339af9453f00f2305821d68ba0c775ede76 diff --git a/src/renderer.cpp b/src/renderer.cpp index f249a47..7bd014d 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -346,34 +346,48 @@ void Render::buildConsumer(const QString &profileName) audioDriver = KdenliveSettings::autoaudiodrivername(); */ - if (!audioDriver.isEmpty()) { + if (!audioDriver.isEmpty()) + m_mltConsumer->set("audio_driver", audioDriver.toUtf8().constData()); + + m_mltConsumer->set("frequency", 48000); + m_mltConsumer->set("real_time", KdenliveSettings::mltthreads()); + #ifdef USE_JACK + if (!audioDriver.isEmpty()) { if(audioDriver == "jack") { - // create the jack device singleton instance - JackDevice::singleton(m_mltProfile); - if(&JACKDEV && JACKDEV.probe()) - openDevice(Device::Jack); - /* TODO: error message */ -// else -// ShowErrorMessage(); - } else -#endif - { - m_mltConsumer->set("audio_driver", audioDriver.toUtf8().constData()); + /* I hate the enumeration shit here */ + if(m_name == Kdenlive::projectMonitor) { + /* create the jack device singleton instance */ + JackDevice::singleton(m_mltProfile); + if(&JACKDEV && JACKDEV.probe()) + openDevice(Device::Jack); + /* TODO: error message */ +// else +// ShowErrorMessage(); + } else if (m_name == Kdenlive::clipMonitor) { + /* stop consumer */ + if (!m_mltConsumer->is_stopped()) + m_mltConsumer->stop(); + /* disable audio */ + m_mltConsumer->set("audio_off", 1); + } + } + } else { + if(m_name == Kdenlive::projectMonitor) { + /* if jackd is running default to jackdev because in most cases the + * audio driver is claimed by jackd */ + JackDevice::singleton(m_mltProfile); + if(&JACKDEV && JACKDEV.probe()) + openDevice(Device::Jack); + } else if (m_name == Kdenlive::clipMonitor) { + /* stop consumer */ + if (!m_mltConsumer->is_stopped()) + m_mltConsumer->stop(); + /* disable audio */ + m_mltConsumer->set("audio_off", 1); } - } -#ifdef USE_JACK - else { - /* if jackd is running default to jackdev because in most cases the - * audio driver is claimed by jackd */ - JackDevice::singleton(m_mltProfile); - if(&JACKDEV && JACKDEV.probe()) - openDevice(Device::Jack); } #endif - - m_mltConsumer->set("frequency", 48000); - m_mltConsumer->set("real_time", KdenliveSettings::mltthreads()); } Mlt::Producer *Render::invalidProducer(const QString &id) |