decklinkaudio{src,sink}: Only start streams / scheduled playback if there is a videosrc at this point

This commit is contained in:
Sebastian Dröge 2015-02-09 17:15:21 +01:00
parent 349113d15a
commit 408f0870a6
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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);