Commit b3e29297 authored by Laurent Aimar's avatar Laurent Aimar

Fixed vorbis encoder.

parent dcc1d93d
...@@ -818,15 +818,14 @@ static int OpenEncoder( vlc_object_t *p_this ) ...@@ -818,15 +818,14 @@ static int OpenEncoder( vlc_object_t *p_this )
/* Create and store headers */ /* Create and store headers */
vorbis_analysis_headerout( &p_sys->vd, &p_sys->vc, vorbis_analysis_headerout( &p_sys->vd, &p_sys->vc,
&header[0], &header[1], &header[2]); &header[0], &header[1], &header[2]);
p_enc->fmt_out.i_extra = 3 * 2 + header[0].bytes + for( int i = 0; i < 3; i++ )
header[1].bytes + header[2].bytes;
p_extra = p_enc->fmt_out.p_extra = xmalloc( p_enc->fmt_out.i_extra );
for( i = 0; i < 3; i++ )
{ {
*(p_extra++) = header[i].bytes >> 8; if( xiph_AppendHeaders( &p_enc->fmt_out.i_extra, &p_enc->fmt_out.p_extra,
*(p_extra++) = header[i].bytes & 0xFF; header[i].bytes, header[i].packet ) )
memcpy( p_extra, header[i].packet, header[i].bytes ); {
p_extra += header[i].bytes; p_enc->fmt_out.i_extra = 0;
p_enc->fmt_out.p_extra = NULL;
}
} }
p_sys->i_channels = p_enc->fmt_in.audio.i_channels; p_sys->i_channels = p_enc->fmt_in.audio.i_channels;
......
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