| Summary: | -[AVPlayerItem currentTime] and -[AVPlayer isExternalPlaybackActive] deadlock | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ada Chan <adachan> | ||||||
| Component: | Web Audio | Assignee: | Ada Chan <adachan> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | crogers, eric.carlson, jer.noble, jonlee, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Ada Chan
2015-07-18 23:12:43 PDT
Eric Carlson suggested this change:
void AudioContext::isPlayingAudioDidChange()
{
- document()->updateIsPlayingMedia();
+ RefPtr<AudioContext> strongThis(this);
+ callOnMainThread([strongThis] {
+ strongThis->document()->updateIsPlayingMedia();
+ });
}
I could reproduce this deadlock before this change, and could not reproduce the deadlock anymore after this change.
Posting a patch very soon.
Created attachment 257056 [details]
Patch
Fix as suggested by Eric. Thanks Eric!
Committed: http://trac.webkit.org/changeset/187025 Comment on attachment 257056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257056&action=review > Source/WebCore/Modules/webaudio/AudioContext.cpp:1076 > + strongThis->document()->updateIsPlayingMedia(); What guarantees that document() is non-null later when this is called on the main thread? It seems we could have a problem if this is pending when the audio context’s document is destroyed. That's a good point. I'll post a followup patch to address that. Created attachment 257160 [details]
Followup patch
Add a null check for document() in case the audio context's document has been destroyed by the time it's called on the main thread.
Thanks Eric! Follow-up patch has been committed: http://trac.webkit.org/changeset/187098 |