From: Jan Alexander Steffens (heftig) Date: Fri, 23 Jul 2021 14:20:20 +0000 (+0200) Subject: input-selector: Use proper segments when cleaning cached buffers X-Git-Tag: 1.19.3~536 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97601e49cb84bd0bbcbb8b72bbadbee13615a8c7;p=platform%2Fupstream%2Fgstreamer.git input-selector: Use proper segments when cleaning cached buffers We need to use the segment associated with the cached buffer, not the current segment of the pad, otherwise we miscalculate the running time of cached buffers from before a segment change. Part-of: --- diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 4d509e2..069e732 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -914,7 +914,6 @@ gst_input_selector_cleanup_old_cached_buffers (GstInputSelector * sel, GST_DEBUG_OBJECT (sel, "Cleaning up old cached buffers"); for (walk = GST_ELEMENT_CAST (sel)->sinkpads; walk; walk = g_list_next (walk)) { GstSelectorPad *selpad; - GstSegment *seg; GstSelectorPadCachedBuffer *cached_buffer; GSList *maybe_remove; guint queue_position; @@ -923,13 +922,12 @@ gst_input_selector_cleanup_old_cached_buffers (GstInputSelector * sel, if (!selpad->cached_buffers) continue; - seg = &selpad->segment; - maybe_remove = NULL; queue_position = 0; while ((cached_buffer = g_queue_peek_nth (selpad->cached_buffers, queue_position))) { GstBuffer *buffer = cached_buffer->buffer; + GstSegment *seg = &cached_buffer->segment; GstClockTime running_time; GSList *l;