From 7e566bbe6ce367e880bf09e293a9e72e52c0988e Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Wed, 2 Jun 2010 10:54:45 +0000 Subject: Implement av_get_codec_tag_string() and use it in ffprobe. Originally committed as revision 23421 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffprobe.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'ffprobe.c') diff --git a/ffprobe.c b/ffprobe.c index 7cb6167b05..4be5d0f875 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -120,7 +120,6 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) AVCodec *dec; char val_str[128]; AVMetadataTag *tag = NULL; - char a, b, c, d; AVRational display_aspect_ratio; printf("[STREAM]\n"); @@ -139,16 +138,9 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den); /* print AVI/FourCC tag */ - a = dec_ctx->codec_tag & 0xff; - b = dec_ctx->codec_tag>>8 & 0xff; - c = dec_ctx->codec_tag>>16 & 0xff; - d = dec_ctx->codec_tag>>24 & 0xff; - printf("codec_tag_string="); - if (isprint(a)) printf("%c", a); else printf("[%d]", a); - if (isprint(b)) printf("%c", b); else printf("[%d]", b); - if (isprint(c)) printf("%c", c); else printf("[%d]", c); - if (isprint(d)) printf("%c", d); else printf("[%d]", d); - printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag); + av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag); + printf("codec_tag_string=%s\n", val_str); + printf("codec_tag=0x%04x\n", dec_ctx->codec_tag); switch (dec_ctx->codec_type) { case AVMEDIA_TYPE_VIDEO: -- cgit v1.2.3