chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.28k stars 458 forks source link

Audio capture passes silent packets at start #3242

Open magreenblatt opened 2 years ago

magreenblatt commented 2 years ago

Original report by pkv (Bitbucket: pkvstream).


We implemented the new audio capture API from https://bitbucket.org/chromiumembedded/cef/pull-requests/264 in obs-studio and got into a bug.

The first few calls of OnAudioStreamPacket return silent frames.

For instance if kFramesPerBuffer = 1024 , the first four calls to OnAudioStreamPacket always return zero’d data (so for stereo audio about 40 ms at start are muted).

Repro steps:

  1. implement Audio Handler. ex: https://github.com/obsproject/obs-browser/pull/249
  2. play in cef some audio, ex: bug checked with YouTube audio, and also alerts
  3. breakpoint at OnAudioStreamPacket calls and check that the first few calls return mute audio

(checked on windows & macOS, with CEF 95 [4638] and 97)

Occurs 100% of the time.

@{557058:fa93fd38-48f9-4d02-853b-7ac82338c84b} @{5c5d80592183761cd5ec2450} Any idea what’s wrong ? I’m pinging also @{557058:87710afa-227e-4a82-a5d0-a4281d0a858b} since he had written some customizations to the API.

I don’t think our implementation of the API is faulty; I’d venture a guess that chromium must have changed something since the audio handler was merged for CEF 4103.

magreenblatt commented 2 years ago

Original comment by Matt Gajownik (Bitbucket: WizardCM, GitHub: WizardCM).


Confirmed this bug still exists in 106.0.20+g354064a+chromium-106.0.5249.12 (Spotify build)