Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f686ca89c6e15f061c8669b19fc7344eb5612adb
      
https://github.com/WebKit/WebKit/commit/f686ca89c6e15f061c8669b19fc7344eb5612adb
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2025-11-13 (Thu, 13 Nov 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/MediaSourcePrivate.cpp
    M Source/WebCore/platform/graphics/MediaSourcePrivate.h
    M Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
    M Source/WebCore/platform/graphics/SourceBufferPrivate.h

  Log Message:
  -----------
  [MSE] Make MediaSourcePrivate::hasAudio/hasVideo thread-safe
https://bugs.webkit.org/show_bug.cgi?id=302250
rdar://164393150

Reviewed by Youenn Fablet.

MediaSourcePrivate::hasAudio/hasVideo are called from the MediaPlayerPrivate
from the main thread. Those methods need to be thread-safe as MediaSourcePrivate
may be running on a different workqueue.
We can let the SourceBufferPrivate tells the MediaSourcePrivate at the time
the information is received rather than have MediaSourcePrivate call
into SourceBufferPrivate instead.

No change in observable heaviour.
* Source/WebCore/platform/graphics/MediaSourcePrivate.cpp:
(WebCore::MediaSourcePrivate::removeSourceBuffer):
(WebCore::MediaSourcePrivate::hasAudio const):
(WebCore::MediaSourcePrivate::hasVideo const):
(WebCore::MediaSourcePrivate::tracksTypeChanged):
(WebCore::MediaSourcePrivate::updateTracksType):
* Source/WebCore/platform/graphics/MediaSourcePrivate.h:
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::addTrackBuffer):
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::hasAudio const): Deleted.
(WebCore::SourceBufferPrivate::hasVideo const): Deleted.

Canonical link: https://commits.webkit.org/302975@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to