+ return GST_FLOW_OK;
+}
+
+static GstFlowReturn
+handle_buffer (GstSubParse * self, GstBuffer * buf)
+{
+ GstFlowReturn ret = GST_FLOW_OK;
+ gchar *line, *subtitle;
+
+ GST_DEBUG_OBJECT (self, "%" GST_PTR_FORMAT, buf);
+
+ if (self->first_buffer) {
+ GstMapInfo map;
+
+ gst_buffer_map (buf, &map, GST_MAP_READ);
+ self->detected_encoding =
+ gst_sub_parse_detect_encoding ((gchar *) map.data, map.size);
+ gst_buffer_unmap (buf, &map);
+ self->first_buffer = FALSE;
+ self->state.fps_n = self->fps_n;
+ self->state.fps_d = self->fps_d;
+ }
+
+ feed_textbuf (self, buf);
+
+ ret = check_initial_events (self);
+ if (ret != GST_FLOW_OK)
+ return ret;
+