&& ((p_first)->i_physical_channels == (p_second)->i_physical_channels)\
&& ((p_first)->i_original_channels == (p_second)->i_original_channels) )
+#define AOUT_FMT_LINEAR( p_format ) \
+ (aout_BitsPerSample((p_format)->i_format) != 0)
+
#define VLC_CODEC_SPDIFL VLC_FOURCC('s','p','d','i')
#define VLC_CODEC_SPDIFB VLC_FOURCC('s','p','d','b')
-#define AOUT_FMT_NON_LINEAR( p_format ) \
+#define AOUT_FMT_SPDIF( p_format ) \
( ((p_format)->i_format == VLC_CODEC_SPDIFL) \
|| ((p_format)->i_format == VLC_CODEC_SPDIFB) \
|| ((p_format)->i_format == VLC_CODEC_A52) \
!= p_filter->fmt_out.audio.i_physical_channels
|| p_filter->fmt_in.audio.i_original_channels
!= p_filter->fmt_out.audio.i_original_channels
- || AOUT_FMT_NON_LINEAR( &p_filter->fmt_in.audio ) )
+ || !AOUT_FMT_LINEAR( &p_filter->fmt_in.audio ) )
return VLC_EGENERIC;
p_filter->pf_audio_filter = DoWork;
p_aout->pf_flush = NULL;
aout_VolumeSoftInit( p_aout );
- if( AOUT_FMT_NON_LINEAR( &p_aout->format )
+ if( AOUT_FMT_SPDIF( &p_aout->format )
&& var_InheritBool( p_this, "spdif" ) )
{
p_aout->format.i_format = VLC_CODEC_SPDIFL;
pcm_format = SND_PCM_FORMAT_U8;
break;
default:
- if (AOUT_FMT_NON_LINEAR(&p_aout->format))
+ if (AOUT_FMT_SPDIF(&p_aout->format))
spdif = var_InheritBool (p_aout, "spdif");
if (HAVE_FPU)
{
}
/* Check for Digital mode or Analog output mode */
- if( AOUT_FMT_NON_LINEAR( &p_aout->format ) && p_sys->b_supports_digital )
+ if( AOUT_FMT_SPDIF( &p_aout->format ) && p_sys->b_supports_digital )
{
if( OpenSPDIF( p_aout ) )
{
var_Set( p_aout, "audio-device", val );
/* Test for SPDIF support */
- if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if ( AOUT_FMT_SPDIF( &p_aout->format ) )
{
if( CreateDSBuffer( p_aout, VLC_CODEC_SPDIFL,
p_aout->format.i_physical_channels,
free( psz_format );
p_aout->format.i_format = format_int[i];
- if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if ( AOUT_FMT_SPDIF( &p_aout->format ) )
{
p_aout->format.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->format.i_frame_length = A52_FRAME_NB;
}
/* Test for spdif. */
- if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if ( AOUT_FMT_SPDIF( &p_aout->format ) )
{
i_format = AFMT_AC3;
}
/* Set the output format */
- if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if ( AOUT_FMT_SPDIF( &p_aout->format ) )
{
int i_format = AFMT_AC3;
aout_PacketInit( p_aout, &p_sys->packet, A52_FRAME_NB );
aout_VolumeNoneInit( p_aout );
}
-
- if ( !AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ else
{
unsigned int i_format = AFMT_S16_NE;
unsigned int i_frame_size, i_fragments;
}
/* Test for SPDIF support */
- if ( AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if ( AOUT_FMT_SPDIF( &p_aout->format ) )
{
if( OpenWaveOut( p_aout,
p_aout->sys->i_wave_device_id,
else
{
assert( infmt->i_format != outfmt->i_format );
- if( AOUT_FMT_NON_LINEAR( infmt ) )
- {
- if( AOUT_FMT_NON_LINEAR( outfmt ) )
- return -1; /* no indirect non-linear -> non-linear */
- /* NOTE: our non-linear -> linear filters always output 32-bits */
- midfmt->i_format = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_FI32;
- }
- else
+ if( AOUT_FMT_LINEAR( infmt ) )
/* NOTE: Use S16N as intermediate. We have all conversions to S16N,
* and all useful conversions from S16N. TODO: FL32 if HAVE_FPU. */
midfmt->i_format = VLC_CODEC_S16N;
+ else
+ if( AOUT_FMT_LINEAR( outfmt ) )
+ /* NOTE: our non-linear -> linear filters always output 32-bits */
+ midfmt->i_format = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_FI32;
+ else
+ return -1; /* no indirect non-linear -> non-linear */
}
aout_FormatPrepare( midfmt );
char *const ppsz_array[] = { psz_scaletempo, psz_filters, psz_visual };
p_input->p_playback_rate_filter = NULL;
- for( i_visual = 0; i_visual < 3 && !AOUT_FMT_NON_LINEAR(&chain_output_format); i_visual++ )
+ for( i_visual = 0; i_visual < 3 && AOUT_FMT_LINEAR(&chain_output_format); i_visual++ )
{
char *psz_next = NULL;
char *psz_parser = ppsz_array[i_visual];
}
/* Create resamplers. */
- if (!AOUT_FMT_NON_LINEAR(&owner->mixer_format))
+ if (AOUT_FMT_LINEAR(&owner->mixer_format))
{
chain_output_format.i_rate = (__MAX(p_input->input.i_rate,
owner->mixer_format.i_rate)
/* Choose the mixer format. */
owner->mixer_format = p_aout->format;
- if (AOUT_FMT_NON_LINEAR(&p_aout->format))
+ if (!AOUT_FMT_LINEAR(&p_aout->format))
owner->mixer_format.i_format = p_format->i_format;
else
/* Most audio filters can only deal with single-precision,
prev_date = p_buffer->i_pts + p_buffer->i_length;
}
- if( !AOUT_FMT_NON_LINEAR( &p_aout->format ) )
+ if( AOUT_FMT_LINEAR( &p_aout->format ) )
{
p_buffer = p_fifo->p_first;
aout_packet_t *p = aout_packet (p_aout);
aout_fifo_t *p_fifo = &p->fifo;
block_t *p_buffer;
- const bool b_can_sleek = AOUT_FMT_NON_LINEAR (&p_aout->format);
+ const bool b_can_sleek = AOUT_FMT_LINEAR (&p_aout->format);
const mtime_t now = mdate ();
const mtime_t threshold =
(b_can_sleek ? start_date : now) - AOUT_MAX_PTS_DELAY;