Commit cf1d116b authored by Olivier Crête's avatar Olivier Crête 👻
Browse files

pcapparse: Reset state on flush and state changes

https://bugzilla.gnome.org/show_bug.cgi?id=753152
parent 1cb3e8c5
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
*/ */
/* TODO: /* TODO:
* - React on state-change and update state accordingly.
* - Implement support for timestamping the buffers. * - Implement support for timestamping the buffers.
*/ */
...@@ -604,9 +603,6 @@ out: ...@@ -604,9 +603,6 @@ out:
if (list) if (list)
gst_buffer_list_unref (list); gst_buffer_list_unref (list);
if (ret != GST_FLOW_OK)
gst_pcap_parse_reset (self);
return ret; return ret;
} }
...@@ -621,10 +617,33 @@ gst_pcap_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) ...@@ -621,10 +617,33 @@ gst_pcap_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
/* Drop it, we'll replace it with our own */ /* Drop it, we'll replace it with our own */
gst_event_unref (event); gst_event_unref (event);
break; break;
case GST_EVENT_FLUSH_STOP:
gst_pcap_parse_reset (self);
break;
default: default:
ret = gst_pad_push_event (self->src_pad, event); ret = gst_pad_push_event (self->src_pad, event);
break; break;
} }
return ret;
}
static GstStateChangeReturn
gst_pcap_parse_change_state (GstElement * element, GstStateChange transition)
{
GstPcapParse *self = GST_PCAP_PARSE (element);
GstStateChangeReturn ret;
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_pcap_parse_reset (element);
break;
default:
break;
}
return ret; return ret;
} }
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