From a1a2efc970c8937ba8ab428d919c061c16d57c72 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 5 May 2020 22:57:08 -0400 Subject: [PATCH] validate:flow: Handle some more segment fields filtering Those slept through when implementing filtering Part-of: --- validate/plugins/flow/formatting.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/validate/plugins/flow/formatting.c b/validate/plugins/flow/formatting.c index a2d915f2ff..73b540e2cd 100644 --- a/validate/plugins/flow/formatting.c +++ b/validate/plugins/flow/formatting.c @@ -75,7 +75,7 @@ validate_flow_format_segment (const GstSegment * segment, { Uint64Formatter uint64_format; gchar *segment_str; - gchar *parts[10]; + gchar *parts[12]; GString *format; gchar start_str[32], offset_str[32], stop_str[32], time_str[32], base_str[32], position_str[32], duration_str[32]; @@ -111,12 +111,18 @@ validate_flow_format_segment (const GstSegment * segment, if (segment->applied_rate != 1.0) parts[parts_index++] = g_strdup_printf ("applied_rate=%f", segment->applied_rate); - if (segment->flags) + + if (segment->flags && use_field ("flags", logged_fields, ignored_fields)) parts[parts_index++] = g_strdup_printf ("flags=0x%02x", segment->flags); - parts[parts_index++] = - g_strdup_printf ("time=%s, base=%s, position=%s", time_str, base_str, - position_str); - if (GST_CLOCK_TIME_IS_VALID (segment->duration)) + + if (use_field ("time", logged_fields, ignored_fields)) + parts[parts_index++] = g_strdup_printf ("time=%s", time_str); + if (use_field ("base", logged_fields, ignored_fields)) + parts[parts_index++] = g_strdup_printf ("base=%s", base_str); + if (use_field ("position", logged_fields, ignored_fields)) + parts[parts_index++] = g_strdup_printf ("position=%s", position_str); + if (GST_CLOCK_TIME_IS_VALID (segment->duration) + && use_field ("duration", logged_fields, ignored_fields)) parts[parts_index++] = g_strdup_printf ("duration=%s", duration_str); parts[parts_index] = NULL;