Commit 315defaa authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Paul Saman

Sync with 0.8.6d and trunk.

parent b3515f9f
......@@ -373,8 +373,8 @@ struct sout_stream_sys_t
vlc_fourcc_t i_acodec; /* codec audio (0 if not transcode) */
char *psz_aenc;
sout_cfg_t *p_audio_cfg;
int i_sample_rate;
unsigned int i_channels;
uint32_t i_sample_rate;
uint32_t i_channels;
int i_abitrate;
char *psz_afilters[TRANSCODE_FILTERS];
sout_cfg_t *p_afilters_cfg[TRANSCODE_FILTERS];
......@@ -936,7 +936,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
if( p_fmt->psz_language )
id->p_encoder->fmt_out.psz_language = strdup( p_fmt->psz_language );
if( p_fmt->i_cat == AUDIO_ES && (p_sys->i_acodec || p_sys->psz_aenc) )
if( (p_fmt->i_cat == AUDIO_ES) && (p_sys->i_acodec || p_sys->psz_aenc) )
{
msg_Dbg( p_stream,
"creating audio transcoding from fcc=`%4.4s' to fcc=`%4.4s'",
......@@ -945,7 +945,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
/* Complete destination format */
id->p_encoder->fmt_out.i_codec = p_sys->i_acodec;
id->p_encoder->fmt_out.audio.i_rate = ( p_sys->i_sample_rate > 0 ) ?
p_sys->i_sample_rate : (int)p_fmt->audio.i_rate;
p_sys->i_sample_rate : p_fmt->audio.i_rate;
id->p_encoder->fmt_out.i_bitrate = p_sys->i_abitrate;
id->p_encoder->fmt_out.audio.i_bitspersample =
p_fmt->audio.i_bitspersample;
......@@ -1311,13 +1311,17 @@ static int transcode_audio_new( sout_stream_t *p_stream,
msg_Err( p_stream, "cannot find decoder" );
return VLC_EGENERIC;
}
id->p_decoder->fmt_out.audio.i_bitspersample =
id->p_decoder->fmt_out.audio.i_bitspersample =
audio_BitsPerSample( id->p_decoder->fmt_out.i_codec );
fmt_last = id->p_decoder->fmt_out;
/* FIX decoders so we don't have to do this */
fmt_last.audio.i_rate = id->p_decoder->fmt_in.audio.i_rate;
/*
/* Fix AAC SBR changing number of channels and sampling rate */
if( !(id->p_decoder->fmt_in.i_codec == VLC_FOURCC('m','p','4','a') &&
(fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate) &&
(fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels)) )
fmt_last.audio.i_rate = id->p_decoder->fmt_in.audio.i_rate;
/*
* Open encoder
*/
......@@ -1356,8 +1360,10 @@ static int transcode_audio_new( sout_stream_t *p_stream,
audio_BitsPerSample( id->p_encoder->fmt_in.i_codec );
/* Load conversion filters */
if( (fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels) ||
(fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate) )
/* Fix AAC SBR changing number of channels and sampling rate */
if( ( id->p_decoder->fmt_in.i_codec == VLC_FOURCC('m','p','4','a') ) &&
( fmt_last.audio.i_rate != id->p_encoder->fmt_in.audio.i_rate ) &&
( fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels ) )
{
/* We'll have to go through fl32 first */
es_format_t fmt_out = id->p_encoder->fmt_in;
......
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