Commit 1e079a0c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Don't query our own source pad to convert duration.

parent e92c851d
...@@ -1139,21 +1139,23 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query) ...@@ -1139,21 +1139,23 @@ static gboolean query_function(GstPad *pad, GstObject *parent, GstQuery *query)
{ {
struct gstdemux *This = gst_pad_get_element_private(pad); struct gstdemux *This = gst_pad_get_element_private(pad);
GstFormat format; GstFormat format;
int ret;
LONGLONG duration;
TRACE("filter %p, type %s.\n", This, GST_QUERY_TYPE_NAME(query)); TRACE("filter %p, type %s.\n", This, GST_QUERY_TYPE_NAME(query));
switch (GST_QUERY_TYPE(query)) { switch (GST_QUERY_TYPE(query)) {
case GST_QUERY_DURATION: case GST_QUERY_DURATION:
gst_query_parse_duration (query, &format, NULL); gst_query_parse_duration(query, &format, NULL);
if (format == GST_FORMAT_PERCENT) { if (format == GST_FORMAT_PERCENT)
gst_query_set_duration (query, GST_FORMAT_PERCENT, GST_FORMAT_PERCENT_MAX); {
gst_query_set_duration(query, GST_FORMAT_PERCENT, GST_FORMAT_PERCENT_MAX);
return TRUE; return TRUE;
} }
ret = gst_pad_query_convert (pad, GST_FORMAT_BYTES, This->filesize, format, &duration); else if (format == GST_FORMAT_BYTES)
gst_query_set_duration(query, format, duration); {
return ret; gst_query_set_duration(query, GST_FORMAT_BYTES, This->filesize);
return TRUE;
}
return FALSE;
case GST_QUERY_SEEKING: case GST_QUERY_SEEKING:
gst_query_parse_seeking (query, &format, NULL, NULL, NULL); gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
if (format != GST_FORMAT_BYTES) if (format != GST_FORMAT_BYTES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment