WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
213 stars 136 forks source link

[wpe-2.38] Fix audio sink detection #1214

Closed Scony closed 6 months ago

Scony commented 10 months ago

This PR addresses the following flow:

  1. audio playback is about to start
  2. playbin2 detects ABC audio sink, and tries to use it
  3. ABC sink transitions from NULL to READY and notifies webkit
  4. webkit updates m_audioSink
  5. playbin2 decides to reject ABC audio sink and tries XYZ audio sink instead
  6. ABC sink transitions from READY to NULL without notifing webkit
  7. XYZ sink transitions from NULL to READY and notifies webkit
  8. webkit does not update m_audioSink
  9. playback starts
  10. position queries are performed against ABC sink and therefore make no sense

So, the proposed fix is basically to do an extra check to detect such situation and update m_audioSink to the correct sink.

modeveci commented 10 months ago

I think it is ok to merge as this part of code has been created for platform specific behaviours. @philn is it ok to merge these changes?

philn commented 10 months ago

The patch looks good, but i think @calvaris usually lands things in upstream main first and then backports, right?

calvaris commented 10 months ago

I do merge them when I can and my duties allow it.

calvaris commented 6 months ago

Landed upstream, backported to 2.38 as 7c28049671dc91f967c7487a1a6bda01bcec7905 .