Commit 0498efe2 authored by Laurent Aimar's avatar Laurent Aimar

Fixed flac packetizer when compiling with libflac (close #1194 again ;)

parent 2a86f364
......@@ -271,7 +271,6 @@ static int OpenDecoder( vlc_object_t *p_this )
#ifdef USE_LIBFLAC
p_dec->pf_decode_audio = DecodeBlock;
#endif
p_dec->pf_packetize = PacketizeBlock;
return VLC_SUCCESS;
}
......@@ -286,6 +285,8 @@ static int OpenPacketizer( vlc_object_t *p_this )
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
i_ret = OpenDecoder( p_this );
p_dec->pf_decode_audio = NULL;
p_dec->pf_packetize = PacketizeBlock;
/* Set output properties */
p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','a','c');
......@@ -646,6 +647,8 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
decoder_t *p_dec = (decoder_t *)client_data;
decoder_sys_t *p_sys = p_dec->p_sys;
if( p_dec->pf_decode_audio )
{
switch( metadata->data.stream_info.bits_per_sample )
{
case 8:
......@@ -660,6 +663,7 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
break;
}
}
/* Setup the format */
p_dec->fmt_out.audio.i_rate = metadata->data.stream_info.sample_rate;
......
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