- m_mltConsumer = new Mlt::Consumer(*m_mltProfile, "sdl_audio");
- m_mltConsumer->set("preview_off", 1);
- m_mltConsumer->set("preview_format", mlt_image_rgb24a);
- m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) consumer_gl_frame_show);
+ if (!m_mltConsumer) {
+ if (KdenliveSettings::external_display() && m_name != Kdenlive::ClipMonitor) {
+ int device = KdenliveSettings::blackmagic_output_device();
+ if (device >= 0) {
+ QString decklink = "decklink:" + QString::number(KdenliveSettings::blackmagic_output_device());
+ m_mltConsumer = new Mlt::Consumer(*m_mltProfile, decklink.toUtf8().constData());
+ // Set defaults for decklink consumer
+ if (m_mltConsumer) {
+ m_mltConsumer->set("terminate_on_pause", 0);
+ m_mltConsumer->set("deinterlace_method", KdenliveSettings::mltdeinterlacer().toUtf8().constData());
+ externalConsumer = true;
+ }
+ }
+ }
+ if (!m_mltConsumer || !m_mltConsumer->is_valid()) {
+ m_mltConsumer = new Mlt::Consumer(*m_mltProfile, "sdl_audio");
+ m_mltConsumer->set("scrub_audio", 1);
+ m_mltConsumer->set("preview_off", 1);
+ m_mltConsumer->set("audio_buffer", 512);
+ m_mltConsumer->set("mlt_image_format", "glsl");
+ m_consumerThreadStartedEvent = m_mltConsumer->listen("consumer-thread-started", this, (mlt_listener) consumer_thread_started);
+ m_consumerThreadStoppedEvent = m_mltConsumer->listen("consumer-thread-stopped", this, (mlt_listener) consumer_thread_stopped);
+ }
+ m_mltConsumer->set("buffer", "1");
+ m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) consumer_gl_frame_show);
+ }