Mercurial > mplayer.hg
comparison libao2/ao_pcm.c @ 25315:dfa8a510c81c
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
author | ulion |
---|---|
date | Mon, 10 Dec 2007 16:53:30 +0000 |
parents | 7a6a7f47109f |
children | 9946e4a6e457 |
comparison
equal
deleted
inserted
replaced
25314:02e2e7a5599a | 25315:dfa8a510c81c |
---|---|
6 | 6 |
7 #include "libavutil/common.h" | 7 #include "libavutil/common.h" |
8 #include "mpbswap.h" | 8 #include "mpbswap.h" |
9 #include "subopt-helper.h" | 9 #include "subopt-helper.h" |
10 #include "libaf/af_format.h" | 10 #include "libaf/af_format.h" |
11 #include "libaf/reorder_ch.h" | |
11 #include "audio_out.h" | 12 #include "audio_out.h" |
12 #include "audio_out_internal.h" | 13 #include "audio_out_internal.h" |
13 #include "mp_msg.h" | 14 #include "mp_msg.h" |
14 #include "help_mp.h" | 15 #include "help_mp.h" |
15 | 16 |
198 buffer[i] = le2me_16(buffer[i]); | 199 buffer[i] = le2me_16(buffer[i]); |
199 } | 200 } |
200 } | 201 } |
201 #endif | 202 #endif |
202 | 203 |
204 if (ao_data.channels == 6 || ao_data.channels == 5) { | |
205 int frame_size = le2me_16(wavhdr.bits) / 8; | |
206 len -= len % (frame_size * ao_data.channels); | |
207 reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, | |
208 AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT, | |
209 ao_data.channels, | |
210 len / frame_size, frame_size); | |
211 } | |
212 | |
203 //printf("PCM: Writing chunk!\n"); | 213 //printf("PCM: Writing chunk!\n"); |
204 fwrite(data,len,1,fp); | 214 fwrite(data,len,1,fp); |
205 | 215 |
206 if(ao_pcm_waveheader) | 216 if(ao_pcm_waveheader) |
207 wavhdr.data_length += len; | 217 wavhdr.data_length += len; |