changeset 69:0686eeb0c21b libavformat

prettier debug output
author mmu_man
date Tue, 25 Feb 2003 13:12:41 +0000
parents 1e2f55eced38
children e851fa232508
files asf.c
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Tue Feb 25 09:36:53 2003 +0000
+++ b/asf.c	Tue Feb 25 13:12:41 2003 +0000
@@ -659,14 +659,36 @@
 //#define DEBUG
 
 #ifdef DEBUG
+#define PRINT_IF_GUID(g,cmp) \
+if (!memcmp(g, &cmp, sizeof(GUID))) \
+    printf("(GUID: %s) ", #cmp)
+
 static void print_guid(const GUID *g)
 {
     int i;
+    PRINT_IF_GUID(g, asf_header);
+    else PRINT_IF_GUID(g, file_header);
+    else PRINT_IF_GUID(g, stream_header);
+    else PRINT_IF_GUID(g, audio_stream);
+    else PRINT_IF_GUID(g, audio_conceal_none);
+    else PRINT_IF_GUID(g, video_stream);
+    else PRINT_IF_GUID(g, video_conceal_none);
+    else PRINT_IF_GUID(g, comment_header);
+    else PRINT_IF_GUID(g, codec_comment_header);
+    else PRINT_IF_GUID(g, codec_comment1_header);
+    else PRINT_IF_GUID(g, data_header);
+    else PRINT_IF_GUID(g, index_guid);
+    else PRINT_IF_GUID(g, head1_guid);
+    else PRINT_IF_GUID(g, head2_guid);
+    else PRINT_IF_GUID(g, my_guid);
+    else
+        printf("(GUID: unknown) ");
     printf("0x%08x, 0x%04x, 0x%04x, {", g->v1, g->v2, g->v3);
     for(i=0;i<8;i++)
         printf(" 0x%02x,", g->v4[i]);
     printf("}\n");
 }
+#undef PRINT_IF_GUID(g,cmp)
 #endif
 
 static void get_guid(ByteIOContext *s, GUID *g)