Skip to content

Commit d0b6c67

Browse files
philncalvaris
authored andcommitted
[GStreamer] SinksWorkarounds leak and version check fix
https://bugs.webkit.org/show_bug.cgi?id=257420 Reviewed by Alicia Boya Garcia and Xabier Rodriguez-Calvar. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3471 was merged in 1.23, so the version check should account for this. Also drive-by fix leak of gst_version_string(). * Source/WebCore/platform/graphics/gstreamer/GStreamerSinksWorkarounds.cpp: (WebCore::BaseSinkPositionFlushWorkaroundProbe::checkIsNeeded): Canonical link: https://commits.webkit.org/264672@main
1 parent 23a801c commit d0b6c67

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static WorkaroundMode getWorkAroundModeFromEnvironment(const char* environmentVa
6969
}
7070

7171
// Workaround for: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3471 basesink: Support position queries after non-resetting flushes.
72-
// Fix will land in GStreamer 1.24.0.
72+
// Fix merged in 1.23, will ship in GStreamer 1.24.0.
7373

7474
class BaseSinkPositionFlushWorkaroundProbe {
7575
public:
@@ -99,7 +99,10 @@ class BaseSinkPositionFlushWorkaroundProbe {
9999

100100
static bool checkIsNeeded()
101101
{
102-
GST_DEBUG("BaseSinkPositionFlushWorkaroundProbe: running GStreamer %s, the bug fix is expected to land in 1.24.0.", gst_version_string());
102+
#ifndef GST_DISABLE_GST_DEBUG
103+
GUniquePtr<char> versionString(gst_version_string());
104+
GST_DEBUG("BaseSinkPositionFlushWorkaroundProbe: running GStreamer %s, the bug fix is was merged in 1.23 and is expected to ship in 1.24.0.", versionString.get());
105+
#endif
103106
WorkaroundMode mode = getWorkAroundModeFromEnvironment("WEBKIT_GST_WORKAROUND_BASE_SINK_POSITION_FLUSH", WEBKIT_GST_WORKAROUND_BASE_SINK_POSITION_FLUSH_DEFAULT_MODE);
104107
if (mode == WorkaroundMode::ForceEnable) {
105108
GST_DEBUG("BaseSinkPositionFlushWorkaroundProbe: forcing workaround to be enabled.");
@@ -110,7 +113,7 @@ class BaseSinkPositionFlushWorkaroundProbe {
110113
return false;
111114
}
112115

113-
return !webkitGstCheckVersion(1, 24, 0);
116+
return !webkitGstCheckVersion(1, 23, 0);
114117
}
115118

116119
static void initializeIsNeeded()

0 commit comments

Comments
 (0)