changeset 2856:9211043e0784 libavcodec

print fourcc in a readable form if possible
author michael
date Sat, 03 Sep 2005 20:36:24 +0000
parents da95623de901
children 303b270eee3d
files utils.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sat Sep 03 09:17:30 2005 +0000
+++ b/utils.c	Sat Sep 03 20:36:24 2005 +0000
@@ -767,12 +767,14 @@
         codec_name = enc->codec_name;
     } else {
         /* output avi tags */
-        if (enc->codec_type == CODEC_TYPE_VIDEO) {
-            snprintf(buf1, sizeof(buf1), "%c%c%c%c", 
+        if(   isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF) 
+           && isprint((enc->codec_tag>>16)&0xFF) && isprint((enc->codec_tag>>24)&0xFF)){
+            snprintf(buf1, sizeof(buf1), "%c%c%c%c / 0x%04X", 
                      enc->codec_tag & 0xff,
                      (enc->codec_tag >> 8) & 0xff,
                      (enc->codec_tag >> 16) & 0xff,
-                     (enc->codec_tag >> 24) & 0xff);
+                     (enc->codec_tag >> 24) & 0xff,
+                      enc->codec_tag);
         } else {
             snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);
         }