summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-06-14 20:48:29 +0100
committerTim-Philipp Müller <tim@centricular.com>2015-06-14 21:25:29 +0100
commit7be8acbfb0e08ea8bcd6833a7e0a71d1132f6b14 (patch)
tree5e49313a7806276d15d16538117ab30cfafcaf3f
parent2448a62ff441be21cbf7c3788470f14926d14916 (diff)
typefindelement: reset segment only once streaming has stopped
Fixes the occasional criticals in the discoverer unit test. https://bugzilla.gnome.org/show_bug.cgi?id=745073 https://bugzilla.gnome.org/show_bug.cgi?id=750823
-rw-r--r--plugins/elements/gsttypefindelement.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c
index df5862736..f9d3e378e 100644
--- a/plugins/elements/gsttypefindelement.c
+++ b/plugins/elements/gsttypefindelement.c
@@ -1196,17 +1196,18 @@ gst_type_find_element_activate_sink_mode (GstPad * pad, GstObject * parent,
typefind->offset = 0;
res = TRUE;
} else {
- gst_segment_init (&typefind->segment, GST_FORMAT_UNDEFINED);
res = gst_pad_stop_task (pad);
+ gst_segment_init (&typefind->segment, GST_FORMAT_UNDEFINED);
}
break;
case GST_PAD_MODE_PUSH:
- gst_segment_init (&typefind->segment, GST_FORMAT_UNDEFINED);
- if (active)
+ if (active) {
+ gst_segment_init (&typefind->segment, GST_FORMAT_UNDEFINED);
start_typefinding (typefind);
- else
+ } else {
stop_typefinding (typefind);
-
+ gst_segment_init (&typefind->segment, GST_FORMAT_UNDEFINED);
+ }
res = TRUE;
break;
default: