diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-09-01 04:08:41 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-09-01 04:08:41 +0000 |
commit | b822540787bcecffb5170ac808ebb7df9f01a0d1 (patch) | |
tree | c018376325e4705c9ea428bd55d95269bc364e1f /src/xine-engine | |
parent | b9eb785a112c0a759fc30152a88ee2e9f38a11f2 (diff) | |
download | xine-lib-b822540787bcecffb5170ac808ebb7df9f01a0d1.tar.gz xine-lib-b822540787bcecffb5170ac808ebb7df9f01a0d1.tar.bz2 |
Add proper support for 4.1 and 5 channel setups.
For 4.1, the output comes out on 3 stereo jacks, but the Center has been mixed with the Front speakers.
For 5, the LFE channel has been dropped.
CVS patchset: 5324
CVS date: 2003/09/01 04:08:41
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_out.c | 13 | ||||
-rw-r--r-- | src/xine-engine/audio_out.h | 24 |
2 files changed, 20 insertions, 17 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 7df86a47c..43bd0b3aa 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.139 2003/08/29 20:35:44 miguelfreitas Exp $ + * $Id: audio_out.c,v 1.140 2003/09/01 04:08:41 jcdutton Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -480,8 +480,8 @@ static int mode_channels( int mode ) { return 2; case AO_CAP_MODE_4CHANNEL: return 4; + case AO_CAP_MODE_4_1CHANNEL: case AO_CAP_MODE_5CHANNEL: - return 5; case AO_CAP_MODE_5_1CHANNEL: return 6; } @@ -675,12 +675,8 @@ static audio_buffer_t* prepare_samples( aos_t *this, audio_buffer_t *buf) { this->frame_buf[1]->mem, num_output_frames); buf = swap_frame_buffers(this); break; + case AO_CAP_MODE_4_1CHANNEL: case AO_CAP_MODE_5CHANNEL: - ensure_buffer_size(this->frame_buf[1], 10, num_output_frames); - audio_out_resample_5channel (buf->mem, buf->num_frames, - this->frame_buf[1]->mem, num_output_frames); - buf = swap_frame_buffers(this); - break; case AO_CAP_MODE_5_1CHANNEL: ensure_buffer_size(this->frame_buf[1], 12, num_output_frames); audio_out_resample_6channel (buf->mem, buf->num_frames, @@ -1290,9 +1286,8 @@ static int ao_open(xine_audio_port_t *this_gen, xine_stream_t *stream, case AO_CAP_MODE_4CHANNEL: stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 4; break; + case AO_CAP_MODE_4_1CHANNEL: case AO_CAP_MODE_5CHANNEL: - stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 5; - break; case AO_CAP_MODE_5_1CHANNEL: stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 6; break; diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 8b12d9e3c..e7aba704e 100644 --- a/src/xine-engine/audio_out.h +++ b/src/xine-engine/audio_out.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.h,v 1.57 2003/08/26 21:18:32 miguelfreitas Exp $ + * $Id: audio_out.h,v 1.58 2003/09/01 04:08:41 jcdutton Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -279,14 +279,22 @@ xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only #define AO_CAP_MODE_STEREO 0x00000008 /* driver supports stereo output */ /* 1 sample == 8 bytes (L,R,LR,RR) */ #define AO_CAP_MODE_4CHANNEL 0x00000010 /* driver supports 4 channels */ -/* 1 sample == 10 bytes (L,R,LR,RR,C) */ -#define AO_CAP_MODE_5CHANNEL 0x00000020 /* driver supports 5 channels */ +/* + * Sound cards generally support, 1,2,4,6 channels, but rarely 5. + * So xine will take 4.1, 5 and 6 channel a52 streams and + * down or upmix it correctly to fill the 6 output channels. + * Are there any requests for 2.1 out there? + */ +/* 1 sample == 12 bytes (L,R,LR,RR,Null,LFE) */ +#define AO_CAP_MODE_4_1CHANNEL 0x00000020 /* driver supports 4.1 channels */ +/* 1 sample == 12 bytes (L,R,LR,RR,C, Null) */ +#define AO_CAP_MODE_5CHANNEL 0x00000040 /* driver supports 5 channels */ /* 1 sample == 12 bytes (L,R,LR,RR,C,LFE) */ -#define AO_CAP_MODE_5_1CHANNEL 0x00000040 /* driver supports 5.1 channels */ -#define AO_CAP_MIXER_VOL 0x00000080 /* driver supports mixer control */ -#define AO_CAP_PCM_VOL 0x00000100 /* driver supports pcm control */ -#define AO_CAP_MUTE_VOL 0x00000200 /* driver can mute volume */ -#define AO_CAP_8BITS 0x00000400 /* driver support 8-bit samples */ +#define AO_CAP_MODE_5_1CHANNEL 0x00000080 /* driver supports 5.1 channels */ +#define AO_CAP_MIXER_VOL 0x00000100 /* driver supports mixer control */ +#define AO_CAP_PCM_VOL 0x00000200 /* driver supports pcm control */ +#define AO_CAP_MUTE_VOL 0x00000400 /* driver can mute volume */ +#define AO_CAP_8BITS 0x00000800 /* driver support 8-bit samples */ /* properties supported by get/set_property() */ #define AO_PROP_MIXER_VOL 0 |