Title: [266111] trunk/Source/WebCore
Revision
266111
Author
[email protected]
Date
2020-08-25 07:35:10 -0700 (Tue, 25 Aug 2020)

Log Message

Unreviewed, follow-up to r266109

* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcAllocateBuffersAndRenderAudio): The element clock can be null so we need
to check it before attempting to use it.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266110 => 266111)


--- trunk/Source/WebCore/ChangeLog	2020-08-25 08:46:40 UTC (rev 266110)
+++ trunk/Source/WebCore/ChangeLog	2020-08-25 14:35:10 UTC (rev 266111)
@@ -1,5 +1,13 @@
 2020-08-25  Philippe Normand  <[email protected]>
 
+        Unreviewed, follow-up to r266109
+
+        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+        (webKitWebAudioSrcAllocateBuffersAndRenderAudio): The element clock can be null so we need
+        to check it before attempting to use it.
+
+2020-08-25  Philippe Normand  <[email protected]>
+
         [GStreamer][WebAudio] Fill in output timestamps
         https://bugs.webkit.org/show_bug.cgi?id=215703
 

Modified: trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp (266110 => 266111)


--- trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp	2020-08-25 08:46:40 UTC (rev 266110)
+++ trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp	2020-08-25 14:35:10 UTC (rev 266111)
@@ -349,12 +349,13 @@
         channelBufferList.uncheckedAppend(WTFMove(buffer));
     }
 
+    AudioIOPosition outputTimestamp;
     auto clock = adoptGRef(gst_element_get_clock(GST_ELEMENT_CAST(src)));
-    auto clockTime = gst_clock_get_time(clock.get());
-    auto outputTimestamp = AudioIOPosition {
-        Seconds::fromNanoseconds(timestamp),
-        MonotonicTime::fromRawSeconds(static_cast<double>((g_get_monotonic_time() + GST_TIME_AS_USECONDS(clockTime)) / 1000000.0))
-    };
+    if (clock) {
+        auto clockTime = gst_clock_get_time(clock.get());
+        outputTimestamp.position = Seconds::fromNanoseconds(timestamp);
+        outputTimestamp.timestamp = MonotonicTime::fromRawSeconds(static_cast<double>((g_get_monotonic_time() + GST_TIME_AS_USECONDS(clockTime)) / 1000000.0));
+    }
 
     // FIXME: Add support for local/live audio input.
     priv->provider->render(nullptr, priv->bus, priv->framesToPull, outputTimestamp);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to