Mercurial > libavcodec.hg
comparison utils.c @ 337:8899c3b35b57 libavcodec
* using some small char buffer - needed for sprintf
author | kabi |
---|---|
date | Mon, 22 Apr 2002 19:57:26 +0000 |
parents | ce35fd27bbb0 |
children | bf26081c373c |
comparison
equal
deleted
inserted
replaced
336:c56b45669214 | 337:8899c3b35b57 |
---|---|
217 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) | 217 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
218 { | 218 { |
219 const char *codec_name; | 219 const char *codec_name; |
220 AVCodec *p; | 220 AVCodec *p; |
221 char buf1[32]; | 221 char buf1[32]; |
222 char *channels_str=NULL; | 222 char channels_str[100]; |
223 int bitrate; | 223 int bitrate; |
224 | 224 |
225 if (encode) | 225 if (encode) |
226 p = avcodec_find_encoder(enc->codec_id); | 226 p = avcodec_find_encoder(enc->codec_id); |
227 else | 227 else |
270 snprintf(buf, buf_size, | 270 snprintf(buf, buf_size, |
271 "Audio: %s", | 271 "Audio: %s", |
272 codec_name); | 272 codec_name); |
273 switch (enc->channels) { | 273 switch (enc->channels) { |
274 case 1: | 274 case 1: |
275 channels_str = "mono"; | 275 strcpy(channels_str, "mono"); |
276 break; | 276 break; |
277 case 2: | 277 case 2: |
278 channels_str = "stereo"; | 278 strcpy(channels_str, "stereo"); |
279 break; | 279 break; |
280 case 6: | 280 case 6: |
281 channels_str = "5:1"; | 281 strcpy(channels_str, "5:1"); |
282 break; | 282 break; |
283 default: | 283 default: |
284 sprintf(channels_str, "%d channels", enc->channels); | 284 sprintf(channels_str, "%d channels", enc->channels); |
285 break; | 285 break; |
286 } | 286 } |