comparison utils.c @ 11809:867d82f512df libavcodec

Implement av_get_codec_tag_string() and use it in ffprobe.
author stefano
date Wed, 02 Jun 2010 10:54:45 +0000
parents 22b17f922f2b
children 2ae71694d6ae
comparison
equal deleted inserted replaced
11808:85f6fd5dd599 11809:867d82f512df
798 default: 798 default:
799 bit_rate = 0; 799 bit_rate = 0;
800 break; 800 break;
801 } 801 }
802 return bit_rate; 802 return bit_rate;
803 }
804
805 size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
806 {
807 int i, len, ret = 0;
808
809 for (i = 0; i < 4; i++) {
810 len = snprintf(buf, buf_size,
811 isprint(codec_tag&0xFF) ? "%c" : "[%d]", codec_tag&0xFF);
812 buf += len;
813 buf_size = buf_size > len ? buf_size - len : 0;
814 ret += len;
815 codec_tag>>=8;
816 }
817 return ret;
803 } 818 }
804 819
805 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) 820 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
806 { 821 {
807 const char *codec_name; 822 const char *codec_name;