From 74681cf00a3ab17d54963e7dbb8b2abaf259fd8e Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 29 May 2014 11:55:51 +0200 Subject: [PATCH] examples: factor dumping code We can just re-use the new function instead of having two duplicates --- tests/examples/mpegts/ts-parser.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c index c2ee1bd..9a4eeed 100644 --- a/tests/examples/mpegts/ts-parser.c +++ b/tests/examples/mpegts/ts-parser.c @@ -62,22 +62,6 @@ gst_info_dump_mem_line (gchar * linebuf, gsize linebuf_size, } static void -dump_memory_content (GstMpegTsDescriptor * desc, guint spacing) -{ - gsize off = 0; - - while (off < desc->length) { - gchar buf[128]; - - /* gst_info_dump_mem_line will process 16 bytes at most */ - gst_info_dump_mem_line (buf, sizeof (buf), desc->data, off + 2, - desc->length - off); - g_printf ("%*s %s\n", spacing, "", buf); - off += 16; - } -} - -static void dump_memory_bytes (guint8 * data, guint len, guint spacing) { gsize off = 0; @@ -92,6 +76,8 @@ dump_memory_bytes (guint8 * data, guint len, guint spacing) } } +#define dump_memory_content(desc, spacing) dump_memory_bytes((desc)->data + 2, (desc)->length, spacing) + static const gchar * descriptor_name (gint val) { -- 2.7.4