wavparse: Do not run all typefinders for all output

In order to figure out if the "raw" audio contained within the wav
container is actually DTS, wavparse calls the typefinder helper
except that means it runs all typefinders.

Since it only cares about checking for DTS, we should only run the
audio/x-dts typefinder (if present). Commit 858e516 did not really
fix things.

Use the new type helper with the caps to fix this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3417>
This commit is contained in:
Sanchayan Maity 2022-11-15 21:22:17 +05:30
parent 72c5105312
commit 02fd7fb777

View file

@ -1923,11 +1923,12 @@ gst_wavparse_add_src_pad (GstWavParse * wav, GstBuffer * buf)
if (s && gst_structure_has_name (s, "audio/x-raw") && buf != NULL
&& (GST_BUFFER_OFFSET (buf) == 0 || !GST_BUFFER_OFFSET_IS_VALID (buf))) {
GstTypeFindProbability prob;
GstCaps *tf_caps;
GstCaps *tf_caps, *dts_caps;
dts_caps = gst_caps_from_string ("audio/x-dts");
tf_caps =
gst_type_find_helper_for_buffer_with_extension (GST_OBJECT (wav), buf,
"dts", &prob);
gst_type_find_helper_for_buffer_with_caps (GST_OBJECT (wav), buf,
dts_caps, &prob);
if (tf_caps != NULL) {
GST_LOG ("typefind caps = %" GST_PTR_FORMAT ", P=%d", tf_caps, prob);
if (gst_wavparse_have_dts_caps (tf_caps, prob)) {
@ -1943,6 +1944,7 @@ gst_wavparse_add_src_pad (GstWavParse * wav, GstBuffer * buf)
gst_caps_unref (tf_caps);
}
}
gst_caps_unref (dts_caps);
}
gst_pad_set_caps (wav->srcpad, wav->caps);