From 408f0870a61bc6ce527554d0b56964a67c77bb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 9 Feb 2015 17:15:21 +0100 Subject: [PATCH] decklinkaudio{src,sink}: Only start streams / scheduled playback if there is a videosrc at this point --- sys/decklink/gstdecklinkaudiosink.cpp | 4 ++-- sys/decklink/gstdecklinkaudiosrc.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/decklink/gstdecklinkaudiosink.cpp b/sys/decklink/gstdecklinkaudiosink.cpp index e4a0ec8092..1db93398a3 100644 --- a/sys/decklink/gstdecklinkaudiosink.cpp +++ b/sys/decklink/gstdecklinkaudiosink.cpp @@ -454,7 +454,7 @@ gst_decklink_audio_sink_ringbuffer_release (GstAudioRingBuffer * rb) g_mutex_lock (&self->output->lock); self->output->audio_enabled = FALSE; - if (self->output->start_scheduled_playback) + if (self->output->start_scheduled_playback && self->output->videosink) self->output->start_scheduled_playback (self->output->videosink); g_mutex_unlock (&self->output->lock); @@ -641,7 +641,7 @@ gst_decklink_audio_sink_change_state (GstElement * element, case GST_STATE_CHANGE_PAUSED_TO_PLAYING: g_mutex_lock (&buf->output->lock); buf->output->audio_enabled = TRUE; - if (buf->output->start_scheduled_playback) + if (buf->output->start_scheduled_playback && buf->output->videosink) buf->output->start_scheduled_playback (buf->output->videosink); g_mutex_unlock (&buf->output->lock); break; diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp index 649f2641af..5ccdfdfd12 100644 --- a/sys/decklink/gstdecklinkaudiosrc.cpp +++ b/sys/decklink/gstdecklinkaudiosrc.cpp @@ -378,7 +378,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps) g_mutex_lock (&self->input->lock); self->input->audio_enabled = TRUE; - if (self->input->start_streams) + if (self->input->start_streams && self->input->videosrc) self->input->start_streams (self->input->videosrc); g_mutex_unlock (&self->input->lock); @@ -672,7 +672,7 @@ gst_decklink_audio_src_close (GstDecklinkAudioSrc * self) g_mutex_lock (&self->input->lock); self->input->got_audio_packet = NULL; self->input->audio_enabled = FALSE; - if (self->input->start_streams) + if (self->input->start_streams && self->input->videosrc) self->input->start_streams (self->input->videosrc); g_mutex_unlock (&self->input->lock);