mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
festival: Don't forward all queries
This fixes issues where wavparse would query the file size upstream and assert because the file size is way smaller then what the WAVE header says. This patch disable or cane a handful of queries that make no sense to forward. https://bugzilla.gnome.org/show_bug.cgi?id=791811
This commit is contained in:
parent
12f8410cd2
commit
191c8742d3
1 changed files with 26 additions and 0 deletions
|
@ -112,6 +112,8 @@ static void gst_festival_finalize (GObject * object);
|
|||
|
||||
static GstFlowReturn gst_festival_chain (GstPad * pad, GstObject * parent,
|
||||
GstBuffer * buf);
|
||||
static gboolean gst_festival_src_query (GstPad * pad, GstObject * parent,
|
||||
GstQuery * query);
|
||||
static GstStateChangeReturn gst_festival_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
|
||||
|
@ -184,6 +186,7 @@ gst_festival_init (GstFestival * festival)
|
|||
|
||||
festival->srcpad =
|
||||
gst_pad_new_from_static_template (&src_template_factory, "src");
|
||||
gst_pad_set_query_function (festival->srcpad, gst_festival_src_query);
|
||||
gst_element_add_pad (GST_ELEMENT (festival), festival->srcpad);
|
||||
|
||||
festival->info = festival_default_info ();
|
||||
|
@ -495,6 +498,29 @@ gst_festival_change_state (GstElement * element, GstStateChange transition)
|
|||
return GST_STATE_CHANGE_SUCCESS;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_festival_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||
{
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_POSITION:
|
||||
/* Not supported */
|
||||
return FALSE;
|
||||
case GST_QUERY_DURATION:
|
||||
gst_query_set_duration (query, GST_FORMAT_BYTES, -1);
|
||||
return TRUE;
|
||||
case GST_QUERY_SEEKING:
|
||||
gst_query_set_seeking (query, GST_FORMAT_BYTES, FALSE, 0, -1);
|
||||
return TRUE;
|
||||
case GST_QUERY_FORMATS:
|
||||
gst_query_set_formats (query, 1, GST_FORMAT_BYTES);
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return gst_pad_query_default (pad, parent, query);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue