diff utils.c @ 318:21697f35a9ca libavcodec

- 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.
author pulento
date Tue, 09 Apr 2002 04:52:49 +0000
parents 40d8092e2ff0
children ce35fd27bbb0
line wrap: on
line diff
--- a/utils.c	Tue Apr 09 00:37:06 2002 +0000
+++ b/utils.c	Tue Apr 09 04:52:49 2002 +0000
@@ -219,6 +219,7 @@
     const char *codec_name;
     AVCodec *p;
     char buf1[32];
+    char *channels_str=NULL;
     int bitrate;
 
     if (encode)
@@ -269,12 +270,27 @@
         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: