Changeset 228271 in webkit
- Timestamp:
- Feb 8, 2018 5:10:48 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228266 r228271 1 2018-02-08 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash 4 https://bugs.webkit.org/show_bug.cgi?id=173916 5 6 Reviewed by Xabier Rodriguez Calvar. 7 8 * platform/gtk/TestExpectations: Unskip fixed test. 9 1 10 2018-02-06 Yusuke Suzuki <utatane.tea@gmail.com> 2 11 -
trunk/LayoutTests/platform/gtk/TestExpectations
r228112 r228271 1294 1294 webkit.org/b/172955 media/video-preload.html [ Crash Pass ] 1295 1295 1296 webkit.org/b/173916 webaudio/silent-audio-interrupted-in-background.html [ Skip ]1297 1298 1296 webkit.org/b/175575 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html [ Crash Pass ] 1299 1297 -
trunk/Source/WebCore/ChangeLog
r228265 r228271 1 2018-02-08 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash 4 https://bugs.webkit.org/show_bug.cgi?id=173916 5 6 Reviewed by Xabier Rodriguez Calvar. 7 8 This patch fixes two crashes and a runtime warning: 9 10 - The provider client configuration should be done from the main 11 thread but the no-more-pads signal of deinterleave was fired from 12 a non-main thread. 13 14 - The deinterleave pad-removed signal can be fired for a not fully 15 configured pipeline if the audio context is interrupted. So the 16 peer quark of the removed pad needs to be checked, it might be a 17 null pointer. 18 19 - The provider connects to the deinterleave signals only when a 20 client is provided, so the signal disconnection needs to check 21 that to avoid runtime warnings. 22 23 * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: 24 (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer): 25 Create a main thread notifier. 26 (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer): 27 Invalidate notifier and check a client was set before 28 disconnecting from deinterleave signals. 29 (WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad): 30 Check validity of the pad peer. 31 (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured): 32 Set client from main thread. 33 * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: 34 1 35 2018-02-08 Philippe Normand <pnormand@igalia.com> 2 36 -
trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
r213445 r228271 84 84 85 85 AudioSourceProviderGStreamer::AudioSourceProviderGStreamer() 86 : m_client(nullptr) 86 : m_notifier(MainThreadNotifier<MainThreadNotification>::create()) 87 , m_client(nullptr) 87 88 , m_deinterleaveSourcePads(0) 88 89 , m_deinterleavePadAddedHandlerId(0) … … 97 98 AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer() 98 99 { 100 m_notifier->invalidate(); 101 99 102 GRefPtr<GstElement> deinterleave = adoptGRef(gst_bin_get_by_name(GST_BIN(m_audioSinkBin.get()), "deinterleave")); 100 if (deinterleave ) {103 if (deinterleave && m_client) { 101 104 g_signal_handler_disconnect(deinterleave.get(), m_deinterleavePadAddedHandlerId); 102 105 g_signal_handler_disconnect(deinterleave.get(), m_deinterleaveNoMorePadsHandlerId); … … 319 322 // Remove the queue ! appsink chain downstream of deinterleave. 320 323 GQuark quark = g_quark_from_static_string("peer"); 321 GstPad* sinkPad = reinterpret_cast<GstPad*>(g_object_get_qdata(G_OBJECT(pad), quark)); 324 GstPad* sinkPad = GST_PAD_CAST(g_object_get_qdata(G_OBJECT(pad), quark)); 325 if (!sinkPad) 326 return; 327 322 328 GRefPtr<GstElement> queue = adoptGRef(gst_pad_get_parent_element(sinkPad)); 323 329 GRefPtr<GstPad> queueSrcPad = adoptGRef(gst_element_get_static_pad(queue.get(), "src")); … … 332 338 void AudioSourceProviderGStreamer::deinterleavePadsConfigured() 333 339 { 334 ASSERT(m_client); 335 ASSERT(m_deinterleaveSourcePads == gNumberOfChannels); 336 337 m_client->setFormat(m_deinterleaveSourcePads, gSampleBitRate); 340 m_notifier->notify(MainThreadNotification::DeinterleavePadsConfigured, [this] { 341 ASSERT(m_client); 342 ASSERT(m_deinterleaveSourcePads == gNumberOfChannels); 343 344 m_client->setFormat(m_deinterleaveSourcePads, gSampleBitRate); 345 }); 338 346 } 339 347 -
trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.h
r209871 r228271 24 24 #include "AudioSourceProvider.h" 25 25 #include "GRefPtrGStreamer.h" 26 #include "MainThreadNotifier.h" 26 27 #include <gst/gst.h> 27 28 #include <wtf/Forward.h> … … 54 55 55 56 private: 57 enum MainThreadNotification { 58 DeinterleavePadsConfigured = 1 << 0, 59 }; 60 Ref<MainThreadNotifier<MainThreadNotification>> m_notifier; 56 61 GRefPtr<GstElement> m_audioSinkBin; 57 62 AudioSourceProviderClient* m_client;
Note: See TracChangeset
for help on using the changeset viewer.