diff options
author | wm4 <wm4@nowhere> | 2013-04-05 23:06:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-12 21:24:54 +0200 |
commit | aea2328906fc754c0d0cdea57c60d71522ae99a5 (patch) | |
tree | b57c9ebbfa2a787a16ff90fdd97e2de7f6a420f8 /audio/out/ao_sdl.c | |
parent | 37325f2796afd914ee729cafc3a1624f333a9ae7 (diff) | |
download | mpv-aea2328906fc754c0d0cdea57c60d71522ae99a5.tar.bz2 mpv-aea2328906fc754c0d0cdea57c60d71522ae99a5.tar.xz |
audio/out: switch to channel map
This actually breaks audio for 5/6/8 channels. There's no reordering
done yet. The actual reordering will be done inside of af_lavrresample
and has to be made part of the format negotiation.
Diffstat (limited to 'audio/out/ao_sdl.c')
-rw-r--r-- | audio/out/ao_sdl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c index 7cfb1ae1e2..c91b16e4bc 100644 --- a/audio/out/ao_sdl.c +++ b/audio/out/ao_sdl.c @@ -185,7 +185,7 @@ static int init(struct ao *ao, char *params) #endif } desired.freq = ao->samplerate; - desired.channels = ao->channels; + desired.channels = ao->channels.num; desired.samples = FFMIN(32768, ceil_power_of_two(ao->samplerate * buflen)); desired.callback = audio_callback; desired.userdata = ao; @@ -237,8 +237,9 @@ static int init(struct ao *ao, char *params) } ao->samplerate = obtained.freq; - ao->channels = obtained.channels; - ao->bps = ao->channels * ao->samplerate * bytes; + mp_chmap_from_channels(&ao->channels, obtained.channels); + mp_chmap_reorder_to_alsa(&ao->channels); + ao->bps = ao->channels.num * ao->samplerate * bytes; ao->buffersize = obtained.size * bufcnt; ao->outburst = obtained.size; priv->buffer = av_fifo_alloc(ao->buffersize); |