mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
discoverer: Don't wait for subtitle streams to preroll
Subtitle streams being parse can cause the pipeline to wait indefinitely to PREROLL. This makes subtitle streams got to PAUSED even if no data is available. This should not be a cause for concern as we don't expect to get much data for subtitle streams other than language tags from the container. https://bugzilla.gnome.org/show_bug.cgi?id=632291
This commit is contained in:
parent
ba2e500bd9
commit
9ffb8859d7
1 changed files with 19 additions and 0 deletions
|
@ -443,6 +443,15 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
|
||||||
{
|
{
|
||||||
PrivateStream *ps;
|
PrivateStream *ps;
|
||||||
GstPad *sinkpad = NULL;
|
GstPad *sinkpad = NULL;
|
||||||
|
GstCaps *caps;
|
||||||
|
static GstCaps *subs_caps = NULL;
|
||||||
|
|
||||||
|
if (!subs_caps) {
|
||||||
|
subs_caps = gst_caps_from_string ("text/plain; text/x-pango-markup; "
|
||||||
|
"subpicture/x-pgs; subpicture/x-dvb; application/x-subtitle-unknown; "
|
||||||
|
"application/x-ssa; application/x-ass; subtitle/x-kate; "
|
||||||
|
"video/x-dvd-subpicture; ");
|
||||||
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_OBJECT (dc, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||||
|
|
||||||
|
@ -459,6 +468,16 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
|
||||||
g_object_set (ps->sink, "silent", TRUE, NULL);
|
g_object_set (ps->sink, "silent", TRUE, NULL);
|
||||||
g_object_set (ps->queue, "max-size-buffers", 1, "silent", TRUE, NULL);
|
g_object_set (ps->queue, "max-size-buffers", 1, "silent", TRUE, NULL);
|
||||||
|
|
||||||
|
caps = gst_pad_get_caps_reffed (pad);
|
||||||
|
|
||||||
|
if (gst_caps_can_intersect (caps, subs_caps)) {
|
||||||
|
/* Subtitle streams are sparse and don't provide any information - don't
|
||||||
|
* wait for data to preroll */
|
||||||
|
g_object_set (ps->sink, "async", FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
gst_bin_add_many (dc->priv->pipeline, ps->queue, ps->sink, NULL);
|
gst_bin_add_many (dc->priv->pipeline, ps->queue, ps->sink, NULL);
|
||||||
|
|
||||||
if (!gst_element_link_pads_full (ps->queue, "src", ps->sink, "sink",
|
if (!gst_element_link_pads_full (ps->queue, "src", ps->sink, "sink",
|
||||||
|
|
Loading…
Reference in a new issue