summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-09-03 20:36:24 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-09-03 20:36:24 +0000
commitb983a5c60829ff56bbbc44f101a348021d9c2da0 (patch)
tree389dbce681a0754347a47fe463cad4b4dc5112ef
parentd156a7b7f10c32da970bf3f8ce31814f5d462490 (diff)
print fourcc in a readable form if possible
Originally committed as revision 4554 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ec234f6222..70a3ce7ff5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -767,12 +767,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
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);
}