diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2014-12-31 18:52:34 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-01-05 00:22:11 +0000 |
commit | 3390b70d781a7e2cfe7796e65a8a378a73d95209 (patch) | |
tree | 9de25284169bb52b2983660c81cfc7124706e144 /plugins/elements/gstinputselector.c | |
parent | 266481e9ff77392163d60297ebcfed4c2cf1b62e (diff) |
inputselector: fix silly GQueue iteration code
Not active by default though.
Diffstat (limited to 'plugins/elements/gstinputselector.c')
-rw-r--r-- | plugins/elements/gstinputselector.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index b5da039a5..df2b50e2e 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -801,11 +801,13 @@ gst_input_selector_debug_cached_buffers (GstInputSelector * sel) { GList *walk; - for (walk = GST_ELEMENT_CAST (sel)->sinkpads; walk; walk = g_list_next (walk)) { + if (gst_debug_category_get_threshold (input_selector_debug) < GST_LEVEL_DEBUG) + return; + + for (walk = GST_ELEMENT_CAST (sel)->sinkpads; walk; walk = walk->next) { GstSelectorPad *selpad; GString *timestamps; - gchar *str; - int i; + GList *l; selpad = GST_SELECTOR_PAD_CAST (walk->data); if (!selpad->cached_buffers) { @@ -814,16 +816,14 @@ gst_input_selector_debug_cached_buffers (GstInputSelector * sel) } timestamps = g_string_new ("Cached buffers timestamps:"); - for (i = 0; i < selpad->cached_buffers->length; ++i) { - GstSelectorPadCachedBuffer *cached_buffer; + for (l = selpad->cached_buffers->head; l != NULL; l = l->next) { + GstSelectorPadCachedBuffer *cached_buffer = l->data; - cached_buffer = g_queue_peek_nth (selpad->cached_buffers, i); g_string_append_printf (timestamps, " %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_PTS (cached_buffer->buffer))); } - str = g_string_free (timestamps, FALSE); - GST_DEBUG_OBJECT (selpad, "%s", str); - g_free (str); + GST_DEBUG_OBJECT (selpad, "%s", timestamps->str); + g_string_free (timestamps, TRUE); } } #endif |