Commit 44837797 authored by Ilya Konstantinov's avatar Ilya Konstantinov Committed by Olivier Crête

gst: improve error when agent/stream/component is unset

https://bugs.freedesktop.org/show_bug.cgi?id=89962
parent 718bd720
...@@ -555,6 +555,18 @@ gst_nice_sink_change_state (GstElement * element, GstStateChange transition) ...@@ -555,6 +555,18 @@ gst_nice_sink_change_state (GstElement * element, GstStateChange transition)
"Trying to start Nice sink without an agent set"); "Trying to start Nice sink without an agent set");
return GST_STATE_CHANGE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
else if (sink->stream_id == 0)
{
GST_ERROR_OBJECT (element,
"Trying to start Nice sink without a stream set");
return GST_STATE_CHANGE_FAILURE;
}
else if (sink->component_id == 0)
{
GST_ERROR_OBJECT (element,
"Trying to start Nice sink without a component set");
return GST_STATE_CHANGE_FAILURE;
}
break; break;
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
case GST_STATE_CHANGE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
......
...@@ -403,12 +403,24 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition) ...@@ -403,12 +403,24 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition)
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: case GST_STATE_CHANGE_NULL_TO_READY:
if (src->agent == NULL || src->stream_id == 0 || src->component_id == 0) if (src->agent == NULL)
{ {
GST_ERROR_OBJECT (element, GST_ERROR_OBJECT (element,
"Trying to start Nice source without an agent set"); "Trying to start Nice source without an agent set");
return GST_STATE_CHANGE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
else if (src->stream_id == 0)
{
GST_ERROR_OBJECT (element,
"Trying to start Nice source without a stream set");
return GST_STATE_CHANGE_FAILURE;
}
else if (src->component_id == 0)
{
GST_ERROR_OBJECT (element,
"Trying to start Nice source without a component set");
return GST_STATE_CHANGE_FAILURE;
}
else else
{ {
nice_agent_attach_recv (src->agent, src->stream_id, src->component_id, nice_agent_attach_recv (src->agent, src->stream_id, src->component_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment