mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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
This commit is contained in:
parent
fa370153bc
commit
ed7e0e744f
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue