Commit 519b0809 authored by Christophe Massiot's avatar Christophe Massiot

* modules/codec/lpcm.c: Attempt at supporting all channel configurations,

* Support for 7 and 7.1 channel configurations.
parent a0794f24
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.78 2003/02/09 01:13:43 massiot Exp $
* $Id: audio_output.h,v 1.79 2003/02/11 11:16:04 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -111,7 +111,9 @@ typedef int32_t vlc_fixed_t;
#define AOUT_CHAN_REARCENTER 0x10
#define AOUT_CHAN_REARLEFT 0x20
#define AOUT_CHAN_REARRIGHT 0x40
#define AOUT_CHAN_LFE 0x100
#define AOUT_CHAN_MIDDLELEFT 0x100
#define AOUT_CHAN_MIDDLERIGHT 0x200
#define AOUT_CHAN_LFE 0x1000
/* Values available for original channels only */
#define AOUT_CHAN_DOLBYSTEREO 0x10000
......
......@@ -3,7 +3,7 @@
* -> gives the feeling of a real room with a simple headphone
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: headphone.c,v 1.1 2002/12/09 00:52:42 babal Exp $
* $Id: headphone.c,v 1.2 2003/02/11 11:16:04 massiot Exp $
*
* Authors: Boris Dors <babal@via.ecp.fr>
*
......@@ -260,6 +260,8 @@ static int Create( vlc_object_t *p_this )
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->output.i_physical_channels != ( AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT )
|| (p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLELEFT)
|| (p_filter->input.i_physical_channels & AOUT_CHAN_MIDDLERIGHT)
|| p_filter->input.i_format != p_filter->output.i_format
|| p_filter->input.i_rate != p_filter->output.i_rate
|| (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
......
......@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.10 2003/01/02 20:48:28 gbazin Exp $
* $Id: lpcm.c,v 1.11 2003/02/11 11:16:04 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -176,7 +176,7 @@ static void DecodeFrame( dec_thread_t * p_dec )
aout_buffer_t * p_buffer;
mtime_t i_pts;
uint8_t i_header;
unsigned int i_rate, i_original_channels, i_nb_channels;
unsigned int i_rate, i_original_channels;
/* Look for sync word - should be 0xXX80 */
RealignBits( &p_dec->bit_stream );
......@@ -214,32 +214,41 @@ static void DecodeFrame( dec_thread_t * p_dec )
{
case 0:
i_original_channels = AOUT_CHAN_CENTER;
i_nb_channels = 1;
break;
case 1:
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
i_nb_channels = 2;
break;
case 2:
/* This is unsure. */
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_LFE;
break;
case 3:
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT;
i_nb_channels = 4;
break;
case 4:
/* This is unsure. */
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
| AOUT_CHAN_LFE;
break;
case 5:
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
| AOUT_CHAN_CENTER | AOUT_CHAN_LFE;
i_nb_channels = 6;
break;
case 2:
case 4:
case 6:
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
| AOUT_CHAN_CENTER | AOUT_CHAN_MIDDLELEFT
| AOUT_CHAN_MIDDLERIGHT;
break;
case 7:
default:
msg_Err( p_dec->p_fifo, "unsupported LPCM channels (0x%x)",
i_header );
p_dec->p_fifo->b_error = 1;
return;
i_original_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT
| AOUT_CHAN_CENTER | AOUT_CHAN_MIDDLELEFT
| AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE;
break;
}
if( (p_dec->p_aout_input != NULL) &&
......
......@@ -2,7 +2,7 @@
* common.c : audio output management of common data structures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: common.c,v 1.16 2003/01/23 17:13:28 massiot Exp $
* $Id: common.c,v 1.17 2003/02/11 11:16:04 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -99,7 +99,7 @@ unsigned int aout_FormatNbChannels( const audio_sample_format_t * p_format )
static const uint32_t pi_channels[] =
{ AOUT_CHAN_CENTER, AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
AOUT_CHAN_REARCENTER, AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
AOUT_CHAN_LFE };
AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT, AOUT_CHAN_LFE };
unsigned int i_nb = 0, i;
for ( i = 0; i < sizeof(pi_channels)/sizeof(uint32_t); i++ )
......@@ -235,6 +235,14 @@ const char * aout_FormatPrintChannels( const audio_sample_format_t * p_format )
case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE:
return "3F2R/LFE";
case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
| AOUT_CHAN_MIDDLERIGHT:
return "3F2M2R";
case AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
| AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT
| AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE:
return "3F2M2R/LFE";
}
return "ERROR";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment