diff options
author | 2007-12-10 16:53:30 +0000 | |
---|---|---|
committer | 2007-12-10 16:53:30 +0000 | |
commit | 1ed6e96cfba3c822d333f58c3181d18e0de95d14 (patch) | |
tree | c6162cae9d8a01ddc7bd22931817cd118beffbad /libmpcodecs/ae_pcm.c | |
parent | 24dafeee09a6e724dadf0bf904df1b911020154c (diff) |
Fix all current known multi-channel wrong order problems by adding
common functions for channel reordering.
This fixes these modules by adding channel reordering code for 5.0/5.1 audio:
ao: pcm
ad: dmo, faad, ffmpeg(ac3, dca, libfaad, liba52), pcm
ae: faac, lavc(ac3, libfaac), pcm
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25343 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ae_pcm.c')
-rw-r--r-- | libmpcodecs/ae_pcm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libmpcodecs/ae_pcm.c b/libmpcodecs/ae_pcm.c index f8d3ababf9..2fcc5e32e0 100644 --- a/libmpcodecs/ae_pcm.c +++ b/libmpcodecs/ae_pcm.c @@ -8,6 +8,7 @@ #include "mp_msg.h" #include "libmpdemux/aviheader.h" #include "libaf/af_format.h" +#include "libaf/reorder_ch.h" #include "libmpdemux/ms_hdr.h" #include "stream/stream.h" #include "libmpdemux/muxer.h" @@ -38,6 +39,14 @@ static int bind_pcm(audio_encoder_t *encoder, muxer_stream_t *mux_a) static int encode_pcm(audio_encoder_t *encoder, uint8_t *dest, void *src, int nsamples, int max_size) { max_size = FFMIN(nsamples, max_size); + if (encoder->params.channels == 6 || encoder->params.channels == 5) { + max_size -= max_size % (encoder->params.channels * 2); + reorder_channel_copy_nch(src, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, + dest, AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT, + encoder->params.channels, + max_size / 2, 2); + } + else memcpy(dest, src, max_size); return max_size; } |