Commit 9a6b90b8 authored by Christophe Massiot's avatar Christophe Massiot

* Made audio_sample_format->i_format a FOURCC to allow the creation of

new ones.
parent bf2f5b00
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.67 2002/09/26 22:40:18 massiot Exp $
* $Id: audio_output.h,v 1.68 2002/09/30 21:32:31 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -40,21 +40,6 @@ struct audio_sample_format_t
* i_nb_samples * i_bytes_per_frame / i_frame_length */
};
#define AOUT_FMT_MU_LAW 0x00000001
#define AOUT_FMT_A_LAW 0x00000002
#define AOUT_FMT_IMA_ADPCM 0x00000004
#define AOUT_FMT_U8 0x00000008
#define AOUT_FMT_S16_LE 0x00000010 /* Little endian signed 16 */
#define AOUT_FMT_S16_BE 0x00000020 /* Big endian signed 16 */
#define AOUT_FMT_S8 0x00000040
#define AOUT_FMT_U16_LE 0x00000080 /* Little endian U16 */
#define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */
#define AOUT_FMT_SPDIF 0x00000400 /* S/PDIF hardware support */
#define AOUT_FMT_FLOAT32 0x00010000
#define AOUT_FMT_FIXED32 0x00020000
#define AOUT_FMT_A52 0x00100000
#define AOUT_FMT_DTS 0x00200000
#define AOUT_FMTS_IDENTICAL( p_first, p_second ) ( \
((p_first)->i_format == (p_second)->i_format) \
&& ((p_first)->i_rate == (p_second)->i_rate) \
......@@ -68,17 +53,17 @@ struct audio_sample_format_t
|| (p_first)->i_channels == -1 || (p_second)->i_channels == -1) )
#ifdef WORDS_BIGENDIAN
# define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
# define AOUT_FMT_U16_NE AOUT_FMT_U16_BE
# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','b')
# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','b')
#else
# define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
# define AOUT_FMT_U16_NE AOUT_FMT_U16_LE
# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','l')
# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','l')
#endif
#define AOUT_FMT_NON_LINEAR( p_format ) \
( ((p_format)->i_format == AOUT_FMT_SPDIF) \
|| ((p_format)->i_format == AOUT_FMT_A52) \
|| ((p_format)->i_format == AOUT_FMT_DTS) )
( ((p_format)->i_format == VLC_FOURCC('s','p','d','i')) \
|| ((p_format)->i_format == VLC_FOURCC('a','5','2',' ')) \
|| ((p_format)->i_format == VLC_FOURCC('d','t','s',' ')) )
/* This is heavily borrowed from libmad, by Robert Leslie <rob@mars.org> */
/*
......
......@@ -2,7 +2,7 @@
* trivial.c : trivial channel mixer plug-in (drops unwanted channels)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.3 2002/09/02 23:21:40 massiot Exp $
* $Id: trivial.c,v 1.4 2002/09/30 21:32:31 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
if ( p_filter->input.i_channels == p_filter->output.i_channels
|| 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 != AOUT_FMT_FLOAT32
&& p_filter->input.i_format != AOUT_FMT_FIXED32) )
|| (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
&& p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
{
return -1;
}
......
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: a52tofloat32.c,v 1.2 2002/09/16 20:46:37 massiot Exp $
* $Id: a52tofloat32.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -96,8 +96,8 @@ static int Create( vlc_object_t * _p_filter )
aout_filter_t * p_filter = (aout_filter_t *)_p_filter;
struct aout_filter_sys_t * p_sys;
if ( p_filter->input.i_format != AOUT_FMT_A52
|| p_filter->output.i_format != AOUT_FMT_FLOAT32 )
if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
|| p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: a52tospdif.c,v 1.12 2002/09/11 23:08:43 stef Exp $
* $Id: a52tospdif.c,v 1.13 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -61,8 +61,8 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_A52
|| p_filter->output.i_format != AOUT_FMT_SPDIF )
if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
|| p_filter->output.i_format != VLC_FOURCC('s','p','d','i') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* fixed32float32.c : converter from fixed32 to float32 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: fixed32tofloat32.c,v 1.8 2002/08/28 22:44:31 massiot Exp $
* $Id: fixed32tofloat32.c,v 1.9 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FIXED32
|| p_filter->output.i_format != AOUT_FMT_FLOAT32 )
if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
|| p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* fixed32tos16.c : converter from fixed32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: fixed32tos16.c,v 1.5 2002/08/21 22:41:59 massiot Exp $
* $Id: fixed32tos16.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -58,7 +58,7 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FIXED32
if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
|| p_filter->output.i_format != AOUT_FMT_S16_NE )
{
return -1;
......
......@@ -2,7 +2,7 @@
* float32tos16.c : converter from float32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos16.c,v 1.9 2002/08/21 22:41:59 massiot Exp $
* $Id: float32tos16.c,v 1.10 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -56,7 +56,7 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
|| p_filter->output.i_format != AOUT_FMT_S16_NE )
{
return -1;
......
......@@ -2,7 +2,7 @@
* float32tos8.c : converter from float32 to signed 8 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos8.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
* $Id: float32tos8.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
|| p_filter->output.i_format != AOUT_FMT_S8 )
if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
|| p_filter->output.i_format != VLC_FOURCC('s','8',' ',' ') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* float32tou16.c : converter from float32 to unsigned 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tou16.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
* $Id: float32tou16.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -58,7 +58,7 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
|| p_filter->output.i_format != AOUT_FMT_U16_NE )
{
return -1;
......
......@@ -2,7 +2,7 @@
* float32tou8.c : converter from float32 to unsigned 8 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tou8.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
* $Id: float32tou8.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
|| p_filter->output.i_format != AOUT_FMT_U8 )
if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
|| p_filter->output.i_format != VLC_FOURCC('u','8',' ',' ') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* s16tofloat32.c : converter from signed 16 bits integer to float32
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32.c,v 1.2 2002/08/21 22:41:59 massiot Exp $
* $Id: s16tofloat32.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -59,7 +59,7 @@ static int Create( vlc_object_t *p_this )
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( p_filter->input.i_format != AOUT_FMT_S16_NE
|| p_filter->output.i_format != AOUT_FMT_FLOAT32 )
|| p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
{
return -1;
}
......
......@@ -3,7 +3,7 @@
* with endianness change
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32swab.c,v 1.5 2002/09/27 23:38:04 massiot Exp $
* $Id: s16tofloat32swab.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -75,9 +75,9 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( (p_filter->input.i_format == AOUT_FMT_S16_LE ||
p_filter->input.i_format == AOUT_FMT_S16_BE)
&& p_filter->output.i_format == AOUT_FMT_FLOAT32
if ( (p_filter->input.i_format == VLC_FOURCC('s','1','6','l') ||
p_filter->input.i_format == VLC_FOURCC('s','1','6','b'))
&& p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
&& p_filter->input.i_format != AOUT_FMT_S16_NE )
{
p_filter->pf_do_work = DoWork;
......
......@@ -2,7 +2,7 @@
* trivial.c : trivial resampler (skips samples or pads with zeroes)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.5 2002/08/24 16:07:48 sam Exp $
* $Id: trivial.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
if ( p_filter->input.i_rate == p_filter->output.i_rate
|| p_filter->input.i_format != p_filter->output.i_format
|| p_filter->input.i_channels != p_filter->output.i_channels
|| (p_filter->input.i_format != AOUT_FMT_FLOAT32
&& p_filter->input.i_format != AOUT_FMT_FIXED32) )
|| (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
&& p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* ugly.c : ugly resampler (changes pitch)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: ugly.c,v 1.2 2002/08/28 22:25:38 massiot Exp $
* $Id: ugly.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
if ( p_filter->input.i_rate == p_filter->output.i_rate
|| p_filter->input.i_format != p_filter->output.i_format
|| p_filter->input.i_channels != p_filter->output.i_channels
|| (p_filter->input.i_format != AOUT_FMT_FLOAT32
&& p_filter->input.i_format != AOUT_FMT_FIXED32) )
|| (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
&& p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
{
return VLC_EGENERIC;
}
......
......@@ -2,7 +2,7 @@
* float32.c : precise float32 audio mixer implementation
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32.c,v 1.4 2002/09/20 23:27:03 massiot Exp $
* $Id: float32.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -55,7 +55,7 @@ static int Create( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
if ( p_aout->mixer.mixer.i_format != AOUT_FMT_FLOAT32 )
if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* trivial.c : trivial mixer plug-in (1 input, no downmixing)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.8 2002/09/28 13:05:16 massiot Exp $
* $Id: trivial.c,v 1.9 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -55,8 +55,8 @@ static int Create( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
if ( p_aout->mixer.mixer.i_format != AOUT_FMT_FLOAT32
&& p_aout->mixer.mixer.i_format != AOUT_FMT_FIXED32 )
if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2')
&& p_aout->mixer.mixer.i_format != VLC_FOURCC('f','i','3','2') )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
* $Id: alsa.c,v 1.12 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
......@@ -136,7 +136,7 @@ static int Open( vlc_object_t *p_this )
else
{
/* Use the internal logic to decide on the device name */
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
{
/* Will probably need some little modification in the case
we want to send some data at a different rate
......@@ -180,7 +180,7 @@ static int Open( vlc_object_t *p_this )
/* Default settings */
p_sys->b_can_sleek = VLC_FALSE;
i_channels = p_aout->output.output.i_channels;
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
{
p_sys->i_buffer_size = ALSA_SPDIF_BUFFER_SIZE;
p_aout->output.i_nb_samples = ALSA_SPDIF_PERIOD_SIZE;
......@@ -195,17 +195,11 @@ static int Open( vlc_object_t *p_this )
/* Compute the settings */
switch (p_aout->output.output.i_format)
{
case AOUT_FMT_MU_LAW: i_format = SND_PCM_FORMAT_MU_LAW; break;
case AOUT_FMT_A_LAW: i_format = SND_PCM_FORMAT_A_LAW; break;
case AOUT_FMT_IMA_ADPCM: i_format = SND_PCM_FORMAT_IMA_ADPCM; break;
case AOUT_FMT_U8: i_format = SND_PCM_FORMAT_U8; break;
case AOUT_FMT_S16_LE: i_format = SND_PCM_FORMAT_S16_LE; break;
case AOUT_FMT_S16_BE: i_format = SND_PCM_FORMAT_S16_BE; break;
case AOUT_FMT_S8: i_format = SND_PCM_FORMAT_S8; break;
case AOUT_FMT_U16_LE: i_format = SND_PCM_FORMAT_U16_LE; break;
case AOUT_FMT_U16_BE: i_format = SND_PCM_FORMAT_U16_BE; break;
case AOUT_FMT_FLOAT32: i_format = SND_PCM_FORMAT_FLOAT; break;
case AOUT_FMT_SPDIF:
case VLC_FOURCC('f','l','3','2'):
i_format = SND_PCM_FORMAT_FLOAT;
break;
case VLC_FOURCC('s','p','d','i'):
/* Override some settings to make S/PDIF work */
p_sys->b_can_sleek = VLC_TRUE;
i_format = SND_PCM_FORMAT_S16_LE;
......@@ -213,7 +207,6 @@ static int Open( vlc_object_t *p_this )
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = ALSA_SPDIF_PERIOD_SIZE;
break;
case AOUT_FMT_FIXED32:
default:
msg_Err( p_aout, "audio output format 0x%x not supported",
p_aout->output.output.i_format );
......
......@@ -2,7 +2,7 @@
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: file.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
* $Id: file.c,v 1.12 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -54,10 +54,16 @@ static void Play ( aout_instance_t * );
static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
"u16_be", "s16_be", "fixed32", "float32",
"spdif", NULL };
static int format_int[] = { AOUT_FMT_U8, AOUT_FMT_S8, AOUT_FMT_U16_NE,
AOUT_FMT_S16_NE, AOUT_FMT_U16_LE, AOUT_FMT_S16_LE,
AOUT_FMT_U16_BE, AOUT_FMT_S16_BE, AOUT_FMT_FIXED32,
AOUT_FMT_FLOAT32, AOUT_FMT_SPDIF };
static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
VLC_FOURCC('s','8',' ',' '),
AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
VLC_FOURCC('u','1','6','l'),
VLC_FOURCC('s','1','6','l'),
VLC_FOURCC('u','1','6','b'),
VLC_FOURCC('s','1','6','b'),
VLC_FOURCC('f','i','3','2'),
VLC_FOURCC('f','l','3','2'),
VLC_FOURCC('s','p','i','f') };
#define PATH_TEXT N_("path of the output file")
#define PATH_LONGTEXT N_("By default samples.raw")
......@@ -111,7 +117,7 @@ static int Open( vlc_object_t * p_this )
}
p_aout->output.output.i_format = format_int[i];
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
{
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
......
......@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.26 2002/09/18 21:21:23 massiot Exp $
* $Id: oss.c,v 1.27 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -158,9 +158,9 @@ static int Open( vlc_object_t *p_this )
}
/* Set the output format */
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
{
i_format = AOUT_FMT_SPDIF;
i_format = VLC_FOURCC('s','p','d','i');
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB;
......@@ -178,7 +178,7 @@ static int Open( vlc_object_t *p_this )
if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0
|| i_format != p_aout->output.output.i_format )
{
if ( i_format == AOUT_FMT_SPDIF )
if ( i_format == VLC_FOURCC('s','p','d','i') )
{
/* Retry with S16 */
msg_Warn( p_aout, "cannot set audio output format (%i)", i_format );
......@@ -199,7 +199,7 @@ static int Open( vlc_object_t *p_this )
}
}
if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
{
/* FIXME */
if ( p_aout->output.output.i_channels > 2 )
......@@ -326,7 +326,7 @@ static int OSSThread( aout_instance_t * p_aout )
int i_tmp, i_size;
byte_t * p_bytes;
if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
{
mtime_t buffered = BufferDuration( p_aout );
......
......@@ -2,7 +2,7 @@
* a52.c: A/52 basic parser
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: a52.c,v 1.13 2002/09/26 22:40:20 massiot Exp $
* $Id: a52.c,v 1.14 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -125,7 +125,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
p_dec->p_aout = NULL;
p_dec->p_aout_input = NULL;
p_dec->p_fifo = p_fifo;
p_dec->output_format.i_format = AOUT_FMT_A52;
p_dec->output_format.i_format = VLC_FOURCC('a','5','2',' ');
/* Init the bitstream */
InitBitstream( &p_dec->bit_stream, p_dec->p_fifo,
......
......@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: decoder.c,v 1.4 2002/09/28 13:05:16 massiot Exp $
* $Id: decoder.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -326,7 +326,7 @@ static int InitThread( adec_thread_t * p_adec )
/* Initialize the thread properties */
p_adec->output_format.i_format = AOUT_FMT_FLOAT32;
p_adec->output_format.i_format = VLC_FOURCC('f','l','3','2');
p_adec->output_format.i_rate = i_rate;
p_adec->output_format.i_channels = i_channels;
p_adec->p_aout = NULL;
......
......@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.3 2002/09/28 13:05:16 massiot Exp $
* $Id: lpcm.c,v 1.4 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -126,7 +126,7 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
/* FIXME : I suppose the number of channel and sampling rate
* are somewhere in the headers */
p_dec->output_format.i_format = AOUT_FMT_S16_BE;
p_dec->output_format.i_format = VLC_FOURCC('s','1','6','b');
p_dec->output_format.i_channels = 2;
p_dec->output_format.i_rate = 48000;
......
......@@ -141,7 +141,7 @@ static int InitThread( mad_adec_thread_t * p_dec )
/* Initialize the thread properties */
p_dec->p_aout = NULL;
p_dec->p_aout_input = NULL;
p_dec->output_format.i_format = AOUT_FMT_FIXED32;
p_dec->output_format.i_format = VLC_FOURCC('f','i','3','2');
/*
* Properties of audio for libmad
......
......@@ -2,7 +2,7 @@
* decoder.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: decoder.c,v 1.4 2002/09/26 22:40:23 massiot Exp $
* $Id: decoder.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -178,7 +178,7 @@ static void DecodeThread( adec_thread_t * p_dec )
}
/* Set output configuration */
p_dec->output_format.i_format = AOUT_FMT_FLOAT32;
p_dec->output_format.i_format = VLC_FOURCC('f','l','3','2');
p_dec->output_format.i_channels = ( sync_info.b_stereo ? 2 : 1 );
p_dec->output_format.i_rate = sync_info.sample_rate;
aout_DateInit( &p_dec->end_date, sync_info.sample_rate );
......
......@@ -2,7 +2,7 @@
* aout.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout.m,v 1.10 2002/09/18 21:21:24 massiot Exp $
* $Id: aout.m,v 1.11 2002/09/30 21:32:33 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -120,7 +120,7 @@ int E_(OpenAudio)( vlc_object_t * p_this )
}
/* We only deal with floats. FIXME : this is where we should do S/PDIF. */
p_aout->output.output.i_format = AOUT_FMT_FLOAT32;
p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
/* Set sample rate and channels per frame */
p_aout->output.output.i_rate = p_sys->stream_format.mSampleRate;
......
......@@ -266,7 +266,7 @@ static int QNXaoutThread( aout_instance_t * p_aout )
int i_tmp, i_size;
byte_t * p_bytes;
if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
{
mtime_t next_date = 0;
......
......@@ -2,7 +2,7 @@
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout.c,v 1.9 2002/09/18 21:21:24 massiot Exp $
* $Id: aout.c,v 1.10 2002/09/30 21:32:33 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -50,7 +50,7 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
{
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
......
......@@ -2,7 +2,7 @@
* common.c : audio output management of common data structures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: common.c,v 1.1 2002/09/26 22:40:25 massiot Exp $
* $Id: common.c,v 1.2 2002/09/30 21:32:33 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -136,32 +136,30 @@ void aout_FormatPrepare( audio_sample_format_t * p_format )
switch ( p_format->i_format )
{
case AOUT_FMT_U8: