Skip to content

Commit 6dde29e

Browse files
blinoeocanha
authored andcommitted
[GStreamer] Avoid using decoding limits for all configurations
https://bugs.webkit.org/show_bug.cgi?id=264941 Reviewed by Philippe Normand. When VIDEO_DECODING_LIMIT support is enabled, after a first call of isContentTypeSupported() with Configuration::Decoding, the video limits are remembered in a static variable. They were then used for all subsequent isContentTypeSupported() calls, regardless of the configuration. This should be limited to Configuration::Decoding. * Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Canonical link: https://commits.webkit.org/270877@main
1 parent 5a3558c commit 6dde29e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,18 +757,21 @@ bool GStreamerRegistryScanner::supportsFeatures(const String& features) const
757757

758758
MediaPlayerEnums::SupportsType GStreamerRegistryScanner::isContentTypeSupported(Configuration configuration, const ContentType& contentType, const Vector<ContentType>& contentTypesRequiringHardwareSupport) const
759759
{
760-
static std::optional<VideoDecodingLimits> videoDecodingLimits;
760+
VideoDecodingLimits* videoDecodingLimits = nullptr;
761761
#ifdef VIDEO_DECODING_LIMIT
762+
static std::optional<VideoDecodingLimits> videoDecodingLimitsDefaults;
762763
static std::once_flag onceFlag;
763764
if (configuration == Configuration::Decoding) {
764765
std::call_once(onceFlag, [] {
765-
videoDecodingLimits = videoDecoderLimitsDefaults();
766-
if (!videoDecodingLimits) {
766+
videoDecodingLimitsDefaults = videoDecoderLimitsDefaults();
767+
if (!videoDecodingLimitsDefaults) {
767768
GST_WARNING("Parsing VIDEO_DECODING_LIMIT failed");
768769
ASSERT_NOT_REACHED();
769770
return;
770771
}
771772
});
773+
if (videoDecodingLimitsDefaults)
774+
videoDecodingLimits = &*videoDecodingLimitsDefaults;
772775
}
773776
#endif
774777

0 commit comments

Comments
 (0)