diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2018-03-27 16:51:30 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-03-27 16:51:30 +0100 |
commit | 4d76070f4ec97c6aecbc55ec27997c523aa2b922 (patch) | |
tree | 4acf46d12f62024253b6aaa1b69758a38cac5d72 /gst/onvif | |
parent | 5d2674f5150f80a82e67547b87d391d3bf32f3ed (diff) |
rtponviftimestamp: fix state change function init/reset
When starting up we need to initialise things *before*
streaming starts, so before we chain up to the parent
class in the state change function. And when we shut
down the element, we need to reset things after streaming
has stopped, so after we chain up to the parent class
in the state change function.
Possibly related to memory leak in:
https://bugzilla.gnome.org/show_bug.cgi?id=794353
Diffstat (limited to 'gst/onvif')
-rw-r--r-- | gst/onvif/gstrtponviftimestamp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c index a9574837a..81b57dbc3 100644 --- a/gst/onvif/gstrtponviftimestamp.c +++ b/gst/onvif/gstrtponviftimestamp.c @@ -185,9 +185,12 @@ gst_rtp_onvif_timestamp_change_state (GstElement * element, GstStateChangeReturn ret; switch (transition) { - case GST_STATE_CHANGE_PAUSED_TO_READY: - purge_cached_buffer_and_events (self); - gst_segment_init (&self->segment, GST_FORMAT_UNDEFINED); + case GST_STATE_CHANGE_READY_TO_PAUSED: + self->ntp_offset = self->prop_ntp_offset; + GST_DEBUG_OBJECT (self, "ntp-offset: %" GST_TIME_FORMAT, + GST_TIME_ARGS (self->ntp_offset)); + self->set_d_bit = TRUE; + self->set_e_bit = FALSE; break; default: break; @@ -200,12 +203,9 @@ gst_rtp_onvif_timestamp_change_state (GstElement * element, return ret; switch (transition) { - case GST_STATE_CHANGE_READY_TO_PAUSED: - self->ntp_offset = self->prop_ntp_offset; - GST_DEBUG_OBJECT (self, "ntp-offset: %" GST_TIME_FORMAT, - GST_TIME_ARGS (self->ntp_offset)); - self->set_d_bit = TRUE; - self->set_e_bit = FALSE; + case GST_STATE_CHANGE_PAUSED_TO_READY: + purge_cached_buffer_and_events (self); + gst_segment_init (&self->segment, GST_FORMAT_UNDEFINED); break; default: break; |