speed: make position query able to convert bytes to time

(same as 744c58d71b but for the
position query)

It was only querying in time, but then trying to use dead bytes
to time conversion code.

Coverity 1139677
This commit is contained in:
Edward Hervey 2014-06-02 10:11:58 +02:00
parent e7a0d7d0ed
commit 16fd917632

View file

@ -275,6 +275,12 @@ speed_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
gst_query_set_position (query, GST_FORMAT_TIME, -1); gst_query_set_position (query, GST_FORMAT_TIME, -1);
if (!gst_pad_peer_query_position (filter->sinkpad, rformat, &cur)) { if (!gst_pad_peer_query_position (filter->sinkpad, rformat, &cur)) {
GST_LOG_OBJECT (filter, "TIME query on peer pad failed, trying BYTES");
rformat = GST_FORMAT_BYTES;
if (!gst_pad_peer_query_position (filter->sinkpad, rformat, &cur)) {
GST_LOG_OBJECT (filter, "BYTES query on peer pad failed too");
goto error;
}
GST_LOG_OBJECT (filter, "query on peer pad failed"); GST_LOG_OBJECT (filter, "query on peer pad failed");
goto error; goto error;
} }