baseparse: make estimating the position in query handler actually work
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 30 Sep 2011 14:25:20 +0000 (15:25 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 30 Sep 2011 14:25:20 +0000 (15:25 +0100)
No point estimating if we don't set the result afterwards.

libs/gst/base/gstbaseparse.c

index f95c3aa..699b191 100644 (file)
@@ -3163,14 +3163,14 @@ gst_base_parse_query (GstPad * pad, GstQuery * query)
           res = TRUE;
         }
         GST_OBJECT_UNLOCK (parse);
-        if (res)
-          gst_query_set_position (query, format, dest_value);
-        else {
+        if (!res) {
           /* no precise result, upstream no idea either, then best estimate */
           /* priv->offset is updated in both PUSH/PULL modes */
           res = gst_base_parse_convert (parse,
               GST_FORMAT_BYTES, parse->priv->offset, format, &dest_value);
         }
+        if (res)
+          gst_query_set_position (query, format, dest_value);
       }
       break;
     }