Commit 89105970 authored by Wim Taymans's avatar Wim Taymans
Browse files

flacenc: fix streamheaders

Fix the caps of flacenc, the reference encoder only support 24 bits in
32 bits.
Set streamheader on output caps.
parent e8ba1ef9
...@@ -91,9 +91,9 @@ static const GstAudioChannelPosition channel_positions[8][8] = { ...@@ -91,9 +91,9 @@ static const GstAudioChannelPosition channel_positions[8][8] = {
}; };
#if G_BYTE_ORDER == G_LITTLE_ENDIAN #if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define FORMATS "{ S8LE, S16LE, S24LE, S32LE } " #define FORMATS "{ S8LE, S16LE, S24LE, S24_32LE } "
#else #else
#define FORMATS "{ S8BE, S16BE, S24BE, S32BE } " #define FORMATS "{ S8BE, S16BE, S24BE, S24_32BE } "
#endif #endif
#define FLAC_SINK_CAPS \ #define FLAC_SINK_CAPS \
...@@ -629,7 +629,7 @@ gst_flac_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter) ...@@ -629,7 +629,7 @@ gst_flac_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter)
gst_value_list_append_value (&v_list, &v); gst_value_list_append_value (&v_list, &v);
g_value_set_static_string (&v, GST_AUDIO_NE (S24)); g_value_set_static_string (&v, GST_AUDIO_NE (S24));
gst_value_list_append_value (&v_list, &v); 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); gst_value_list_append_value (&v_list, &v);
g_value_unset (&v); g_value_unset (&v);
...@@ -773,7 +773,7 @@ setting_src_caps_failed: ...@@ -773,7 +773,7 @@ setting_src_caps_failed:
failed_to_initialize: failed_to_initialize:
{ {
GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, (NULL), GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, (NULL),
("could not initialize encoder (wrong parameters?)")); ("could not initialize encoder (wrong parameters?) %d", init_status));
return FALSE; return FALSE;
} }
} }
...@@ -989,6 +989,7 @@ gst_flac_enc_process_stream_headers (GstFlacEnc * enc) ...@@ -989,6 +989,7 @@ gst_flac_enc_process_stream_headers (GstFlacEnc * enc)
g_value_unset (&array); g_value_unset (&array);
push_headers: 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 /* push header buffers; update caps, so when we push the first buffer the
* negotiated caps will change to caps that include the streamheader field */ * negotiated caps will change to caps that include the streamheader field */
......
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