Commit ed7e0e74 authored by Eunhye Choi's avatar Eunhye Choi Committed by Thiago Santos
Browse files

queue2: not update upstream size with negative value

upstream_size can be negative but queue->upstream_size is unsigned type.
to get a chance to update queue->upstream_size in gst_queue2_get_range()
it should keep the default value.

https://bugzilla.gnome.org/show_bug.cgi?id=753011
parent fa370153
......@@ -3176,7 +3176,13 @@ gst_queue2_update_upstream_size (GstQueue2 * queue)
if (gst_pad_peer_query_duration (queue->sinkpad, GST_FORMAT_BYTES,
&upstream_size)) {
GST_INFO_OBJECT (queue, "upstream size: %" G_GINT64_FORMAT, upstream_size);
queue->upstream_size = upstream_size;
/* upstream_size can be negative but queue->upstream_size is unsigned.
* Prevent setting negative values to it (the query can return -1) */
if (upstream_size >= 0)
queue->upstream_size = upstream_size;
else
queue->upstream_size = 0;
}
}
......
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