From e37ce96b2c2a231f82f570892607a0aeed1f4edf Mon Sep 17 00:00:00 2001 From: blake tregre Date: Mon, 31 Oct 2011 18:56:23 -0700 Subject: [PATCH] decklinksrc: handle flow return properly and provide better message * sys/decklink/gstdecklinksrc.cpp: --- sys/decklink/gstdecklinksrc.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/decklink/gstdecklinksrc.cpp b/sys/decklink/gstdecklinksrc.cpp index a6c5d89f4f..37a306ce15 100644 --- a/sys/decklink/gstdecklinksrc.cpp +++ b/sys/decklink/gstdecklinksrc.cpp @@ -1269,8 +1269,12 @@ gst_decklink_src_task (void *priv) gst_buffer_set_caps (buffer, decklinksrc->video_caps); ret = gst_pad_push (decklinksrc->videosrcpad, buffer); - if (ret != GST_FLOW_OK) { - GST_ELEMENT_ERROR (decklinksrc, CORE, NEGOTIATION, (NULL), (NULL)); + if (! (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED || + ret == GST_FLOW_WRONG_STATE)) { + GST_ELEMENT_ERROR (decklinksrc, STREAM, FAILED, + ("Internal data stream error."), + ("stream stopped, reason %s", + gst_flow_get_name (ret))); } if (gst_pad_is_linked (decklinksrc->audiosrcpad)) { @@ -1299,8 +1303,12 @@ gst_decklink_src_task (void *priv) gst_buffer_set_caps (audio_buffer, decklinksrc->audio_caps); ret = gst_pad_push (decklinksrc->audiosrcpad, audio_buffer); - if (ret != GST_FLOW_OK) { - GST_ELEMENT_ERROR (decklinksrc, CORE, NEGOTIATION, (NULL), (NULL)); + if (! (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED || + ret == GST_FLOW_WRONG_STATE)) { + GST_ELEMENT_ERROR (decklinksrc, STREAM, FAILED, + ("Internal data stream error."), + ("stream stopped, reason %s", + gst_flow_get_name (ret))); } } audio_frame->Release ();