mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
queuearray: Only clear dropped item if it is not returned
This commit is contained in:
parent
2481e542c7
commit
fc3602aec8
1 changed files with 10 additions and 5 deletions
|
@ -607,6 +607,7 @@ gst_queue_array_drop_struct (GstQueueArray * array, guint idx,
|
|||
/* simple case actual_idx == first item */
|
||||
if (actual_idx == first_item_index) {
|
||||
/* clear current head position if needed */
|
||||
if (p_struct == NULL)
|
||||
gst_queue_array_clear_idx (array, idx);
|
||||
|
||||
/* move the head plus one */
|
||||
|
@ -619,6 +620,7 @@ gst_queue_array_drop_struct (GstQueueArray * array, guint idx,
|
|||
/* simple case idx == last item */
|
||||
if (actual_idx == last_item_index) {
|
||||
/* clear current tail position if needed */
|
||||
if (p_struct == NULL)
|
||||
gst_queue_array_clear_idx (array, idx);
|
||||
|
||||
/* move tail minus one, potentially wrapping */
|
||||
|
@ -630,6 +632,7 @@ gst_queue_array_drop_struct (GstQueueArray * array, guint idx,
|
|||
/* non-wrapped case */
|
||||
if (first_item_index < last_item_index) {
|
||||
/* clear idx if needed */
|
||||
if (p_struct == NULL)
|
||||
gst_queue_array_clear_idx (array, idx);
|
||||
|
||||
g_assert (first_item_index < actual_idx && actual_idx < last_item_index);
|
||||
|
@ -648,6 +651,7 @@ gst_queue_array_drop_struct (GstQueueArray * array, guint idx,
|
|||
|
||||
if (actual_idx < last_item_index) {
|
||||
/* clear idx if needed */
|
||||
if (p_struct == NULL)
|
||||
gst_queue_array_clear_idx (array, idx);
|
||||
|
||||
/* actual_idx is before last_item_index, move data towards zero */
|
||||
|
@ -663,6 +667,7 @@ gst_queue_array_drop_struct (GstQueueArray * array, guint idx,
|
|||
|
||||
if (actual_idx > first_item_index) {
|
||||
/* clear idx if needed */
|
||||
if (p_struct == NULL)
|
||||
gst_queue_array_clear_idx (array, idx);
|
||||
|
||||
/* actual_idx is after first_item_index, move data to higher indices */
|
||||
|
|
Loading…
Reference in a new issue