print fourcc in a readable form if possible

Originally committed as revision 4554 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 20 years ago
parent d156a7b7f1
commit b983a5c608
  1. 8
      libavcodec/utils.c

@ -767,12 +767,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
codec_name = enc->codec_name; codec_name = enc->codec_name;
} else { } else {
/* output avi tags */ /* output avi tags */
if (enc->codec_type == CODEC_TYPE_VIDEO) { if( isprint(enc->codec_tag&0xFF) && isprint((enc->codec_tag>>8)&0xFF)
snprintf(buf1, sizeof(buf1), "%c%c%c%c", && 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 & 0xff,
(enc->codec_tag >> 8) & 0xff, (enc->codec_tag >> 8) & 0xff,
(enc->codec_tag >> 16) & 0xff, (enc->codec_tag >> 16) & 0xff,
(enc->codec_tag >> 24) & 0xff); (enc->codec_tag >> 24) & 0xff,
enc->codec_tag);
} else { } else {
snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag); snprintf(buf1, sizeof(buf1), "0x%04x", enc->codec_tag);
} }

Loading…
Cancel
Save