mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
decodebin: Send SEEK events directly to adaptive streaming demuxers
This makes sure that they will always get SEEK events, even if we're currently in the middle of a group switch (i.e. switching to another representation/bitrate/etc). https://bugzilla.gnome.org/show_bug.cgi?id=606382
This commit is contained in:
parent
7d6b6b0313
commit
36b80edb72
1 changed files with 38 additions and 2 deletions
|
@ -2925,11 +2925,13 @@ sink_pad_event_probe (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
|||
}
|
||||
gst_object_unref (otherpeer);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (pad, "No request pads, can't forward event");
|
||||
}
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
gst_object_unref (peer);
|
||||
}
|
||||
|
||||
return proberet;
|
||||
}
|
||||
|
@ -4919,6 +4921,39 @@ gst_decode_pad_unblock (GstDecodePad * dpad)
|
|||
gst_decode_pad_set_blocked (dpad, FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_decode_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||
{
|
||||
GstDecodeBin *dbin = GST_DECODE_BIN (parent);
|
||||
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_SEEK && dbin && dbin->decode_chain) {
|
||||
GstElement *demuxer = NULL;
|
||||
|
||||
/* For adaptive demuxers we send the seek event directly to the demuxer.
|
||||
* See https://bugzilla.gnome.org/show_bug.cgi?id=606382
|
||||
*/
|
||||
CHAIN_MUTEX_LOCK (dbin->decode_chain);
|
||||
if (dbin->decode_chain->adaptive_demuxer) {
|
||||
GstDecodeElement *delem = dbin->decode_chain->elements->data;
|
||||
demuxer = gst_object_ref (delem->element);
|
||||
}
|
||||
CHAIN_MUTEX_UNLOCK (dbin->decode_chain);
|
||||
|
||||
if (demuxer) {
|
||||
gboolean ret;
|
||||
|
||||
GST_DEBUG_OBJECT (dbin,
|
||||
"Sending SEEK event directly to adaptive streaming demuxer %s",
|
||||
GST_OBJECT_NAME (demuxer));
|
||||
ret = gst_element_send_event (demuxer, event);
|
||||
gst_object_unref (demuxer);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return gst_pad_event_default (pad, parent, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_decode_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||
{
|
||||
|
@ -4976,6 +5011,7 @@ gst_decode_pad_new (GstDecodeBin * dbin, GstDecodeChain * chain)
|
|||
|
||||
ppad = gst_proxy_pad_get_internal (GST_PROXY_PAD (dpad));
|
||||
gst_pad_set_query_function (GST_PAD_CAST (ppad), gst_decode_pad_query);
|
||||
gst_pad_set_event_function (GST_PAD_CAST (dpad), gst_decode_pad_event);
|
||||
gst_object_unref (ppad);
|
||||
|
||||
return dpad;
|
||||
|
|
Loading…
Reference in a new issue