From 02fd7fb7779b20cacce55f82b008aa941fe9dff9 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 15 Nov 2022 21:22:17 +0530 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c index 0c624c4599..1b71ccab77 100644 --- a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c +++ b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c @@ -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);