diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstnicesrc.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c index 0f1b9d1..d369e09 100644 --- a/gst/gstnicesrc.c +++ b/gst/gstnicesrc.c @@ -425,13 +425,8 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition) "Trying to start Nice source without a component set"); return GST_STATE_CHANGE_FAILURE; } - else - { - nice_agent_attach_recv (src->agent, src->stream_id, src->component_id, - src->mainctx, gst_nice_src_read_callback, (gpointer) src); - } break; - case GST_STATE_CHANGE_READY_TO_NULL: + case GST_STATE_CHANGE_PAUSED_TO_READY: nice_agent_attach_recv (src->agent, src->stream_id, src->component_id, src->mainctx, NULL, NULL); GST_OBJECT_LOCK (src); @@ -442,7 +437,7 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_READY_TO_NULL: default: break; } @@ -450,6 +445,20 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition) ret = GST_ELEMENT_CLASS (gst_nice_src_parent_class)->change_state (element, transition); + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: + nice_agent_attach_recv (src->agent, src->stream_id, src->component_id, + src->mainctx, gst_nice_src_read_callback, (gpointer) src); + break; + case GST_STATE_CHANGE_NULL_TO_READY: + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_READY_TO_NULL: + default: + break; + } + return ret; } |