diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2021-07-23 17:20:20 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-10-29 13:30:34 +0300 |
commit | 8eebe19cae32764097d9ed55340a730736282275 (patch) | |
tree | bc259f17495b97cb5b1c7cba5c645ad5cc1d9279 | |
parent | 4c7bc588e3233c3b0fbd95af03612d6dc1803b0e (diff) |
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1270>
-rw-r--r-- | plugins/elements/gstinputselector.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 107f3205f0..f472c78c9b 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -913,7 +913,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; @@ -922,13 +921,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; |