If the wav header contains an extended chunk, we want to keep
the codec_data field, but not for raw audio.
This fixes some elements (such as adder) from failing to intersect
raw audio caps which would otherwise be intersectable.
gchar *codec_name = NULL;
GstEvent **event_p;
gint64 upstream_size = 0;
gchar *codec_name = NULL;
GstEvent **event_p;
gint64 upstream_size = 0;
/* search for "_fmt" chunk, which should be first */
while (!wav->got_fmt) {
/* search for "_fmt" chunk, which should be first */
while (!wav->got_fmt) {
if (!caps)
goto unknown_format;
if (!caps)
goto unknown_format;
+ /* If we got raw audio from upstream, we remove the codec_data field,
+ * which may have been added if the wav header included an extended
+ * chunk. We want to keep it for non raw audio.
+ */
+ s = gst_caps_get_structure (caps, 0);
+ if (s && gst_structure_has_name (s, "audio/x-raw")) {
+ gst_structure_remove_field (s, "codec_data");
+ }
+
/* do more sanity checks of header fields
* (these can be sanitized by gst_riff_create_audio_caps()
*/
/* do more sanity checks of header fields
* (these can be sanitized by gst_riff_create_audio_caps()
*/