GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
&self->segment);
+ /* will mark need_segment when receiving segment from upstream,
+ * after FLUSH and all that has happened,
+ * rather than racing with chain */
} else {
GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
}
/* make sure we have exactly three digits after he comma */
p = strchr (s, ',');
- g_assert (p != NULL);
+ if (p == NULL) {
+ /* If there isn't a ',' the timestamp is broken */
+ /* https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/532#note_100179 */
+ GST_WARNING ("failed to parse subrip timestamp string '%s'", s);
+ return FALSE;
+ }
+
++p;
len = strlen (p);
if (len > 3) {
GstSubParse *self = GST_SUBPARSE (parent);
gboolean ret = FALSE;
- GST_DEBUG ("Handling %s event", GST_EVENT_TYPE_NAME (event));
+ GST_LOG_OBJECT (self, "%s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_STREAM_GROUP_DONE:
case GST_EVENT_EOS:{
/* Make sure the last subrip chunk is pushed out even
* if the file does not have an empty line at the end */
if (self->parser_type == GST_SUB_PARSE_FORMAT_SUBRIP ||
self->parser_type == GST_SUB_PARSE_FORMAT_TMPLAYER ||
self->parser_type == GST_SUB_PARSE_FORMAT_MPL2 ||
- self->parser_type == GST_SUB_PARSE_FORMAT_QTTEXT) {
+ self->parser_type == GST_SUB_PARSE_FORMAT_QTTEXT ||
+ self->parser_type == GST_SUB_PARSE_FORMAT_VTT) {
gchar term_chars[] = { '\n', '\n', '\0' };
GstBuffer *buf = gst_buffer_new_and_alloc (2 + 1);
- GST_DEBUG ("EOS. Pushing remaining text (if any)");
+ GST_DEBUG_OBJECT (self, "%s: force pushing of any remaining text",
+ GST_EVENT_TYPE_NAME (event));
+
gst_buffer_fill (buf, 0, term_chars, 3);
gst_buffer_set_size (buf, 2);
/* in either case, let's not simply discard this event;
* trigger sending of the saved requested seek segment
* or the one taken here from upstream */
-
- self->need_segment = TRUE; /* upstream */
+ self->need_segment = TRUE;
#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
SUBPARSE_SEEK_UNLOCK (self);
#endif
-
+
break;
}
case GST_EVENT_FLUSH_START: