Skip to content

Commit

Permalink
uridecodebin3: Forward upstream events to decodebin3 directly
Browse files Browse the repository at this point in the history
Otherwise default handler will try to forward it to sink element
or srcpad which might not be available at that moment.
  • Loading branch information
seungha-yang authored and tp-m committed Oct 14, 2020
1 parent e054b1b commit c7c870e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gst/playback/gsturidecodebin3.c
Expand Up @@ -345,6 +345,8 @@ static GstSourceHandler *new_source_handler (GstURIDecodeBin3 * uridecodebin,

static GstStateChangeReturn gst_uri_decode_bin3_change_state (GstElement *
element, GstStateChange transition);
static gboolean gst_uri_decodebin3_send_event (GstElement * element,
GstEvent * event);

static gboolean
_gst_int_accumulator (GSignalInvocationHint * ihint,
Expand Down Expand Up @@ -515,6 +517,8 @@ gst_uri_decode_bin3_class_init (GstURIDecodeBin3Class * klass)
"Edward Hervey <edward@centricular.com>, Jan Schmidt <jan@centricular.com>");

gstelement_class->change_state = gst_uri_decode_bin3_change_state;
gstelement_class->send_event =
GST_DEBUG_FUNCPTR (gst_uri_decodebin3_send_event);

klass->select_stream = gst_uridecodebin3_select_stream;
}
Expand Down Expand Up @@ -1118,6 +1122,16 @@ gst_uri_decode_bin3_change_state (GstElement * element,
}
}

static gboolean
gst_uri_decodebin3_send_event (GstElement * element, GstEvent * event)
{
GstURIDecodeBin3 *self = GST_URI_DECODE_BIN3 (element);

if (GST_EVENT_IS_UPSTREAM (event) && self->decodebin)
return gst_element_send_event (self->decodebin, event);

return GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
}

gboolean
gst_uri_decode_bin3_plugin_init (GstPlugin * plugin)
Expand Down

0 comments on commit c7c870e

Please sign in to comment.