From dbcb6d5614c9000b9b9e2525a253b5c2f15fb48d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 3 Jun 2015 12:43:52 +0200 Subject: [PATCH] validate: Mark gst_validate_report a G_GNUC_PRINTF Summary: And fix the issue it raised Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D213 Depends on D211 --- validate/gst/validate/gst-validate-pad-monitor.c | 9 +++++---- validate/gst/validate/gst-validate-reporter.c | 8 ++++---- validate/gst/validate/gst-validate-reporter.h | 2 +- validate/gst/validate/media-descriptor.c | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 85ba3b0ef8..2df9845e40 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -1721,7 +1721,7 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor * if ((exp_segment->rate * exp_segment->applied_rate != segment->rate * segment->applied_rate)) GST_VALIDATE_REPORT (pad_monitor, EVENT_NEW_SEGMENT_MISMATCH, - "Rate * applied_rate %d != expected %d", + "Rate * applied_rate %f != expected %f", segment->rate * segment->applied_rate, exp_segment->rate * exp_segment->applied_rate); if (exp_segment->start != segment->start) @@ -1928,9 +1928,10 @@ gst_validate_pad_monitor_check_right_buffer (GstValidatePadMonitor * GST_BUFFER_PTS (wanted_buf) != GST_BUFFER_PTS (buffer)) { GST_VALIDATE_REPORT (pad_monitor, WRONG_BUFFER, - "buffer %" GST_PTR_FORMAT " PTS %ld" - " different than expected: %ld", buffer, - GST_BUFFER_PTS (buffer), GST_BUFFER_PTS (wanted_buf)); + "buffer %" GST_PTR_FORMAT " PTS %" GST_TIME_FORMAT + " different than expected: %" GST_TIME_FORMAT, buffer, + GST_TIME_ARGS (GST_BUFFER_PTS (buffer)), + GST_TIME_ARGS (GST_BUFFER_PTS (wanted_buf))); ret = FALSE; } diff --git a/validate/gst/validate/gst-validate-reporter.c b/validate/gst/validate/gst-validate-reporter.c index 4936aea19c..a34476d702 100644 --- a/validate/gst/validate/gst-validate-reporter.c +++ b/validate/gst/validate/gst-validate-reporter.c @@ -239,11 +239,11 @@ gst_validate_reporter_g_log_func (const gchar * log_domain, GstValidateReporter * reporter) { if (log_level & G_LOG_LEVEL_CRITICAL) - GST_VALIDATE_REPORT (reporter, G_LOG_CRITICAL, message); + GST_VALIDATE_REPORT (reporter, G_LOG_CRITICAL, "%s", message); else if (log_level & G_LOG_LEVEL_WARNING) - GST_VALIDATE_REPORT (reporter, G_LOG_WARNING, message); + GST_VALIDATE_REPORT (reporter, G_LOG_WARNING, "%s", message); else - GST_VALIDATE_REPORT (reporter, G_LOG_ISSUE, message); + GST_VALIDATE_REPORT (reporter, G_LOG_ISSUE, "%s", message); } /** @@ -273,7 +273,7 @@ void gst_validate_reporter_report_simple (GstValidateReporter * reporter, GstValidateIssueId issue_id, const gchar * message) { - gst_validate_report (reporter, issue_id, message); + gst_validate_report (reporter, issue_id, "%s", message); } /** diff --git a/validate/gst/validate/gst-validate-reporter.h b/validate/gst/validate/gst-validate-reporter.h index 79875706c8..108a273a5f 100644 --- a/validate/gst/validate/gst-validate-reporter.h +++ b/validate/gst/validate/gst-validate-reporter.h @@ -100,7 +100,7 @@ const gchar * gst_validate_reporter_get_name (GstValidateReporter * r GstValidateRunner * gst_validate_reporter_get_runner (GstValidateReporter *reporter); void gst_validate_reporter_init (GstValidateReporter * reporter, const gchar *name); void gst_validate_report (GstValidateReporter * reporter, GstValidateIssueId issue_id, - const gchar * format, ...); + const gchar * format, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NO_INSTRUMENT; void gst_validate_report_valist (GstValidateReporter * reporter, GstValidateIssueId issue_id, const gchar * format, va_list var_args); void diff --git a/validate/gst/validate/media-descriptor.c b/validate/gst/validate/media-descriptor.c index 5f22b0288c..93f4bc295c 100644 --- a/validate/gst/validate/media-descriptor.c +++ b/validate/gst/validate/media-descriptor.c @@ -232,7 +232,7 @@ compare_tags (GstMediaDescriptor * ref, StreamNode * rstream, GST_VALIDATE_REPORT (ref, FILE_TAG_DETECTION_INCORRECT, "Reference descriptor for stream %s has NO tags" - " but tags found: %s", all_tags->str); + " but tags found: %s", rstream->id, all_tags->str); g_string_free (all_tags, TRUE); @@ -251,7 +251,7 @@ compare_tags (GstMediaDescriptor * ref, StreamNode * rstream, GST_VALIDATE_REPORT (ref, FILE_TAG_DETECTION_INCORRECT, "Reference descriptor for stream %s has tags:\n %s\n" - " but NO tags found on the stream"); + " but NO tags found on the stream", rstream->id, all_tags->str); g_string_free (all_tags, TRUE); return 0;