[FFmpeg-cvslog] ffplay: only request 4 or 6 channels from SDL, if SDL version is at least 1 .2.8

Marton Balint git at videolan.org
Sat Jun 2 17:09:17 CEST 2012


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Mar 27 22:28:28 2012 +0200| [15751e3fdd66f595f25692d180d6f154af2da11c] | committer: Marton Balint

ffplay: only request 4 or 6 channels from SDL, if SDL version is at least 1.2.8

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15751e3fdd66f595f25692d180d6f154af2da11c
---

 ffplay.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 44ae931..2fae0e5 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2299,7 +2299,7 @@ static int stream_component_open(VideoState *is, int stream_index)
             wanted_channel_layout &= ~AV_CH_LAYOUT_STEREO_DOWNMIX;
             wanted_nb_channels = av_get_channel_layout_nb_channels(wanted_channel_layout);
             /* SDL only supports 1, 2, 4 or 6 channels at the moment, so we have to make sure not to request anything else. */
-            while (wanted_nb_channels > 0 && (wanted_nb_channels == 3 || wanted_nb_channels == 5 || wanted_nb_channels > 6)) {
+            while (wanted_nb_channels > 0 && (wanted_nb_channels == 3 || wanted_nb_channels == 5 || wanted_nb_channels > (SDL_VERSION_ATLEAST(1, 2, 8) ? 6 : 2))) {
                 wanted_nb_channels--;
                 wanted_channel_layout = av_get_default_channel_layout(wanted_nb_channels);
             }



More information about the ffmpeg-cvslog mailing list