avisubtitle: set caps on srcpad to fix issue with discoverer

Set caps from the start so discoverer doesn't blow up on
seeing no negotiated caps between elements on preroll,
which might happen if no subtitle buffers have been
pushed yet at the time. See file from bug #603308.
This commit is contained in:
Tim-Philipp Müller 2011-01-18 09:33:06 +00:00
parent e18e25a324
commit 7d9b7abbd4

View file

@ -333,12 +333,20 @@ gst_avi_subtitle_class_init (GstAviSubtitleClass * klass)
static void
gst_avi_subtitle_init (GstAviSubtitle * self, GstAviSubtitleClass * klass)
{
GstCaps *caps;
self->src = gst_pad_new_from_static_template (&src_template, "src");
gst_element_add_pad (GST_ELEMENT (self), self->src);
self->sink = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_chain_function (self->sink,
GST_DEBUG_FUNCPTR (gst_avi_subtitle_chain));
caps = gst_static_pad_template_get_caps (&src_template);
gst_pad_set_caps (self->src, caps);
gst_caps_unref (caps);
gst_pad_use_fixed_caps (self->src);
gst_element_add_pad (GST_ELEMENT (self), self->sink);
self->subfile = NULL;