Commit 11366935 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/vorbis.c: vorbis encoder takes float32 as input.

* modules/stream_out/transcode.c: respect input requested by encoder.
parent d382c9d9
......@@ -674,7 +674,7 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc->p_sys = p_sys;
p_enc->pf_encode_audio = Encode;
p_enc->fmt_in.i_codec = AUDIO_FMT_S16_NE;
p_enc->fmt_in.i_codec = VLC_FOURCC('f','l','3','2');
p_enc->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
......@@ -797,8 +797,8 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
{
for( j = 0 ; j < p_aout_buf->i_nb_samples ; j++ )
{
buffer[i][j]= ((float)( ((int16_t *)p_aout_buf->p_buffer )
[j * p_sys->i_channels + i ] )) / 32768.f;
buffer[i][j]= ((float *)p_aout_buf->p_buffer)
[j * p_sys->i_channels + i ];
}
}
......
......@@ -873,6 +873,9 @@ static int transcode_audio_new( sout_stream_t *p_stream,
id->p_encoder->fmt_out.audio.i_channels =
__MIN( id->p_encoder->fmt_out.audio.i_channels,
id->p_decoder->fmt_in.audio.i_channels );
id->p_encoder->fmt_out.audio.i_physical_channels =
id->p_encoder->fmt_out.audio.i_original_channels =
pi_channels_maps[id->p_encoder->fmt_out.audio.i_channels];
/* Initialization of encoder format structures */
es_format_Init( &id->p_encoder->fmt_in, AUDIO_ES, AOUT_FMT_S16_NE );
......@@ -896,6 +899,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
id->p_decoder->p_module = 0;
return VLC_EGENERIC;
}
id->p_encoder->fmt_in.audio.i_format = id->p_encoder->fmt_in.audio.i_codec;
/* Check if we need a filter for chroma conversion or resizing */
if( id->p_decoder->fmt_out.i_codec !=
......
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