From: Wim Taymans Date: Tue, 13 Mar 2012 11:40:37 +0000 (+0100) Subject: flacenc: fix streamheaders X-Git-Tag: 1.19.3~509^2~7240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89105970f0594e518505c8896a5dbe4f48380bd1;p=platform%2Fupstream%2Fgstreamer.git flacenc: fix streamheaders Fix the caps of flacenc, the reference encoder only support 24 bits in 32 bits. Set streamheader on output caps. --- diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index c63f7a8..9c7a3ee 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -91,9 +91,9 @@ static const GstAudioChannelPosition channel_positions[8][8] = { }; #if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define FORMATS "{ S8LE, S16LE, S24LE, S32LE } " +#define FORMATS "{ S8LE, S16LE, S24LE, S24_32LE } " #else -#define FORMATS "{ S8BE, S16BE, S24BE, S32BE } " +#define FORMATS "{ S8BE, S16BE, S24BE, S24_32BE } " #endif #define FLAC_SINK_CAPS \ @@ -629,7 +629,7 @@ gst_flac_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter) gst_value_list_append_value (&v_list, &v); g_value_set_static_string (&v, GST_AUDIO_NE (S24)); gst_value_list_append_value (&v_list, &v); - g_value_set_static_string (&v, GST_AUDIO_NE (S32)); + g_value_set_static_string (&v, GST_AUDIO_NE (S24_32)); gst_value_list_append_value (&v_list, &v); g_value_unset (&v); @@ -773,7 +773,7 @@ setting_src_caps_failed: failed_to_initialize: { GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, (NULL), - ("could not initialize encoder (wrong parameters?)")); + ("could not initialize encoder (wrong parameters?) %d", init_status)); return FALSE; } } @@ -989,6 +989,7 @@ gst_flac_enc_process_stream_headers (GstFlacEnc * enc) g_value_unset (&array); push_headers: + gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (enc), caps); /* push header buffers; update caps, so when we push the first buffer the * negotiated caps will change to caps that include the streamheader field */