mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
wavparse: do not include codec_data on raw audio caps
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.
This commit is contained in:
parent
2b9493b5f0
commit
40ae581ef2
1 changed files with 10 additions and 0 deletions
|
@ -1037,6 +1037,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
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) {
|
||||
|
@ -1107,6 +1108,15 @@ gst_wavparse_stream_headers (GstWavParse * wav)
|
|||
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()
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue