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
This commit is contained in:
Tim-Philipp Müller 2015-06-14 20:48:29 +01:00
parent 2448a62ff4
commit 7be8acbfb0

View file

@ -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: