utils: return immediately for -1 conversion

When we are asked to convert -1, we can return immediately with a -1 return
value.
This commit is contained in:
Wim Taymans 2010-11-17 16:46:30 +01:00
parent e84d563033
commit a0cb088284

View file

@ -2268,7 +2268,7 @@ gst_element_query_convert (GstElement * element, GstFormat src_format,
g_return_val_if_fail (dest_format != NULL, FALSE);
g_return_val_if_fail (dest_val != NULL, FALSE);
if (*dest_format == src_format) {
if (*dest_format == src_format || src_val == -1) {
*dest_val = src_val;
return TRUE;
}
@ -3069,7 +3069,7 @@ gst_pad_query_convert (GstPad * pad, GstFormat src_format, gint64 src_val,
g_return_val_if_fail (dest_format != NULL, FALSE);
g_return_val_if_fail (dest_val != NULL, FALSE);
if (*dest_format == src_format) {
if (*dest_format == src_format || src_val == -1) {
*dest_val = src_val;
return TRUE;
}