--- a/gst_plugins_base/gst/subparse/gstssaparse.c Tue Aug 31 15:30:33 2010 +0300
+++ b/gst_plugins_base/gst/subparse/gstssaparse.c Wed Sep 01 12:16:41 2010 +0100
@@ -53,6 +53,7 @@
static gboolean gst_ssa_parse_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_ssa_parse_chain (GstPad * sinkpad, GstBuffer * buf);
+
static void
gst_ssa_parse_base_init (gpointer klass)
{
@@ -107,7 +108,6 @@
parse->ini = NULL;
parse->framed = FALSE;
- parse->send_tags = FALSE;
}
static void
@@ -153,7 +153,6 @@
}
parse->framed = TRUE;
- parse->send_tags = TRUE;
priv = (GstBuffer *) gst_value_get_mini_object (val);
g_return_val_if_fail (priv != NULL, FALSE);
@@ -306,20 +305,11 @@
if (G_UNLIKELY (!parse->framed))
goto not_framed;
- if (G_UNLIKELY (parse->send_tags)) {
- GstTagList *tags;
-
- tags = gst_tag_list_new ();
- gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_SUBTITLE_CODEC,
- "SubStation Alpha", NULL);
- gst_element_found_tags_for_pad (GST_ELEMENT (parse), parse->srcpad, tags);
- parse->send_tags = FALSE;
- }
-
/* make double-sure it's 0-terminated and all */
txt = g_strndup ((gchar *) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
+
if (txt == NULL)
- goto empty_text;
+ return GST_FLOW_UNEXPECTED;
ts = GST_BUFFER_TIMESTAMP (buf);
ret = gst_ssa_parse_push_line (parse, txt, ts, GST_BUFFER_DURATION (buf));
@@ -331,7 +321,6 @@
ret = GST_FLOW_OK;
}
- gst_buffer_unref (buf);
g_free (txt);
return ret;
@@ -341,16 +330,8 @@
{
GST_ELEMENT_ERROR (parse, STREAM, FORMAT, (NULL),
("Only SSA subtitles embedded in containers are supported"));
- gst_buffer_unref (buf);
return GST_FLOW_NOT_NEGOTIATED;
}
-empty_text:
- {
- GST_ELEMENT_WARNING (parse, STREAM, FORMAT, (NULL),
- ("Received empty subtitle"));
- gst_buffer_unref (buf);
- return GST_FLOW_OK;
- }
}
static GstStateChangeReturn