Skip to content

Draft: aout: use a thread for all streams operations and make drain interruptible

Thomas Guillem requested to merge tguillem/vlc:aout-async into master

Cf. this discussion we had one year ago for references: https://mailman.videolan.org/pipermail/vlc-devel/2020-December/140943.html

We talked about 2 major issues with the aout:

  • 1/ Start can be glitchy (specially with BT devices) because the clock is not updated enough between 2 distant plays (critical during the first seconds).
  • 2/ The drain is not interruptible

One year ago, I tried to fix the 1st issue by using an event to report the audio delay and update the clock. It was implemented for Pulse Audio. Unfortunately, it's not possible to do the same thing with all other aout modules.

That's why I thought about using a thread for all streams operations and call time_get/clock_Update between 2 distant aout_DecPlay.

Using a thread could also fix the drain issue, hence, this MR. Indeed, the drain issue is simpler to understand, so I finally decided to begin with it.

I don't really remember if we decided to postpone this particular issue for VLC 5.0 or not. We could think that such issue could need a lot of reworking, but it's not really the case here. Indeed, commits and the new threading code are quite simple (I don't see possible regressions).

It's a Draft, I still need to:

  • Have a look to all aout modules to implement the async drain
  • Implement the time_get/clock_Update between 2 plays.

Merge request reports

Loading