aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorJuanjo <pulento@users.sourceforge.net>2002-04-09 04:52:49 +0000
committerJuanjo <pulento@users.sourceforge.net>2002-04-09 04:52:49 +0000
commite0d2714adc4985198a4c9fadf76508cfe7c131d0 (patch)
tree8907aa932e9da43372590f5454fd7fd231e0983e /libavcodec/utils.c
parent9f862d1133e23c26e7b682c625f380f68cd4627b (diff)
downloadffmpeg-e0d2714adc4985198a4c9fadf76508cfe7c131d0.tar.gz
- Fixed AC3 decoding for 5:1 AC3 streams. Now when calling av_audio_decode for
AC3 set avcodec_context->channels to the desired number channels, if the setting is 0 AC3 decoder will set it to the channels found in the stream. - Changed ffmpeg to cope with the new "way" of AC3 decoding. - ASF muxer now uses Tickers for PTS calculations. Originally committed as revision 393 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 815d215757..e74926841a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -219,6 +219,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
const char *codec_name;
AVCodec *p;
char buf1[32];
+ char *channels_str=NULL;
int bitrate;
if (encode)
@@ -269,12 +270,27 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size,
"Audio: %s",
codec_name);
+ switch (enc->channels) {
+ case 1:
+ channels_str = "mono";
+ break;
+ case 2:
+ channels_str = "stereo";
+ break;
+ case 6:
+ channels_str = "5:1";
+ break;
+ default:
+ sprintf(channels_str, "%d channels", enc->channels);
+ break;
+ }
if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d Hz, %s",
enc->sample_rate,
- enc->channels == 2 ? "stereo" : "mono");
+ channels_str);
}
+
/* for PCM codecs, compute bitrate directly */
switch(enc->codec_id) {
case CODEC_ID_PCM_S16LE: