]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
SDL does not seem to support more than two channels.
authorandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 15 Dec 2007 07:05:14 +0000 (07:05 +0000)
committerandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 15 Dec 2007 07:05:14 +0000 (07:05 +0000)
So, if this is the case, ask for downmixing by the codec.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11223 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffplay.c

index 288df2d41b4ba699c5ba4c200068ee5d7c207fc7..cc4e853440d491e889c1c4f5d85a564d02826567 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1695,10 +1695,12 @@ static int stream_component_open(VideoState *is, int stream_index)
     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;