gchar *codec_name = NULL;
GstEvent **event_p;
gint64 upstream_size = 0;
+ GstStructure *s;
/* search for "_fmt" chunk, which should be first */
while (!wav->got_fmt) {
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()
*/