static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
"s16_le", "u16_be", "s16_be", "fixed32",
"float32", "spdif" };
-static const 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') };
+static const int format_int[] = { VLC_CODEC_U8,
+ VLC_CODEC_S8,
+ VLC_CODEC_U16N, VLC_CODEC_S16N,
+ VLC_CODEC_U16L,
+ VLC_CODEC_S16L,
+ VLC_CODEC_U16B,
+ VLC_CODEC_S16B,
+ VLC_CODEC_FI32,
+ VLC_CODEC_FL32,
+ VLC_CODEC_SPDIFL };
#define FILE_TEXT N_("Output file")
#define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
aout_instance_t * p_aout = (aout_instance_t *)p_this;
char * psz_name, * psz_format;
const char * const * ppsz_compare = format_list;
- vlc_value_t val;
int i_channels, i = 0;
- var_Create( p_this, "audiofile-file", VLC_VAR_STRING|VLC_VAR_DOINHERIT );
- var_Get( p_this, "audiofile-file", &val );
- psz_name = val.psz_string;
+ psz_name = var_CreateGetString( p_this, "audiofile-file" );
if( !psz_name || !*psz_name )
{
msg_Err( p_aout, "you need to specify an output file name" );
p_aout->output.pf_play = Play;
/* Audio format */
- var_Create( p_this, "audiofile-format", VLC_VAR_STRING|VLC_VAR_DOINHERIT );
- var_Get( p_this, "audiofile-format", &val );
- psz_format = val.psz_string;
+ psz_format = var_CreateGetString( p_this, "audiofile-format" );
while ( *ppsz_compare != NULL )
{
}
/* Channels number */
- var_Create( p_this, "audiofile-channels",
- VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
- var_Get( p_this, "audiofile-channels", &val );
- i_channels = val.i_int;
+ i_channels = var_CreateGetInteger( p_this, "audiofile-channels" );
if( i_channels > 0 && i_channels <= CHANNELS_MAX )
{
}
/* WAV header */
- var_Create( p_this, "audiofile-wav", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
- var_Get( p_this, "audiofile-wav", &val );
- p_aout->output.p_sys->b_add_wav_header = val.b_bool;
+ p_aout->output.p_sys->b_add_wav_header = var_CreateGetBool( p_this,
+ "audiofile-wav" );
if( p_aout->output.p_sys->b_add_wav_header )
{
switch( p_aout->output.output.i_format )
{
- case VLC_FOURCC('f','l','3','2'):
+ case VLC_CODEC_FL32:
wh->Format = WAVE_FORMAT_IEEE_FLOAT;
wh->BitsPerSample = sizeof(float) * 8;
break;
- case VLC_FOURCC('u','8',' ',' '):
+ case VLC_CODEC_U8:
wh->Format = WAVE_FORMAT_PCM;
wh->BitsPerSample = 8;
break;
- case VLC_FOURCC('s','1','6','l'):
+ case VLC_CODEC_S16L:
default:
wh->Format = WAVE_FORMAT_PCM;
wh->BitsPerSample = 16;