summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2014-05-29 11:55:51 +0200
committerEdward Hervey <bilboed@bilboed.com>2014-05-29 11:55:51 +0200
commit74681cf00a3ab17d54963e7dbb8b2abaf259fd8e (patch)
treeaa4f64ccde3fbc7aa4946c77ecd5c20d062bc483 /tests
parent1db9d6c9dffeb47b4371e836a7cf559e67c17dd8 (diff)
downloadgstreamer-plugins-bad-74681cf00a3ab17d54963e7dbb8b2abaf259fd8e.tar.gz
examples: factor dumping code
We can just re-use the new function instead of having two duplicates
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/mpegts/ts-parser.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/examples/mpegts/ts-parser.c b/tests/examples/mpegts/ts-parser.c
index c2ee1bd49..9a4eeed6a 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)
{