Commit 14e7e310 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: convert non-linear to FI32 if direct conversion is unavailable

(rather than FL32, which should be the destination format anyway)
parent 4abeb549
......@@ -91,9 +91,11 @@ static int SplitConversion( const audio_sample_format_t *restrict infmt,
{
*midfmt = *outfmt;
/* Lastly: resample (after format conversion and remixing) */
if( infmt->i_rate != outfmt->i_rate )
midfmt->i_rate = infmt->i_rate;
else
/* Penultimately: remix channels (after format conversion) */
if( infmt->i_physical_channels != outfmt->i_physical_channels
|| infmt->i_original_channels != outfmt->i_original_channels )
{
......@@ -101,22 +103,25 @@ static int SplitConversion( const audio_sample_format_t *restrict infmt,
midfmt->i_original_channels = infmt->i_original_channels;
}
else
{
assert( infmt->i_format != outfmt->i_format );
/* Second: convert linear to S16N as intermediate format */
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. */
{
/* All conversion from linear to S16N must be supported directly. */
if( outfmt->i_format == VLC_CODEC_S16N )
return -1;
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 */
/* First: convert non-linear to FI32 as intermediate format */
{
if( outfmt->i_format == VLC_CODEC_FI32 )
return -1;
midfmt->i_format = VLC_CODEC_FI32;
}
assert( !AOUT_FMTS_IDENTICAL( infmt, midfmt ) );
aout_FormatPrepare( midfmt );
return AOUT_FMTS_IDENTICAL( infmt, midfmt ) ? -1 : 0;
return 0;
}
#undef aout_FiltersCreatePipeline
......
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