[FFmpeg-cvslog] r11223 - trunk/ffplay.c

andoma subversion
Sat Dec 15 08:05:14 CET 2007


Author: andoma
Date: Sat Dec 15 08:05:14 2007
New Revision: 11223

Log:
SDL does not seem to support more than two channels.
So, if this is the case, ask for downmixing by the codec.



Modified:
   trunk/ffplay.c

Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c	(original)
+++ trunk/ffplay.c	Sat Dec 15 08:05:14 2007
@@ -1695,10 +1695,12 @@ static int stream_component_open(VideoSt
     if (enc->codec_type == CODEC_TYPE_AUDIO) {
         wanted_spec.freq = enc->sample_rate;
         wanted_spec.format = AUDIO_S16SYS;
-        /* hack for AC3. XXX: suppress that */
-        if (enc->channels > 2)
-            enc->channels = 2;
-        wanted_spec.channels = enc->channels;
+        if(enc->channels > 2) {
+            wanted_spec.channels = 2;
+            enc->request_channels = 2;
+        } else {
+            wanted_spec.channels = enc->channels;
+        }
         wanted_spec.silence = 0;
         wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
         wanted_spec.callback = sdl_audio_callback;




More information about the ffmpeg-cvslog mailing list