Skip to content

codec: videotoolbox: misc fixes and pacing rework

François Cartegnie requested to merge fcartegnie/vlc:vtrebase into master

Current pacing has many issues as it is done at allocation time, which use to deadlock because of uncontrolled decoder output and post decode held allocations.

A timeout hack to prevent those makes it even worse by letting allocations succeed after a certain amount of time, pushing an uncontrolled frame in a pool that will delay following frames even more: house of cards effect. Add to this long frame duration/low frame rate, or large pts delay between frames on frame drop, or simply ... a pause that releases all the decoder buffers: Recipe for chaos.

The reworked pacing works at ingest level and ensures we will never need to allocate more buffers than expected, and will block otherwise.

Other fixes mostly changes code that was not asynchronous and triggering other bugs.

Edited by François Cartegnie

Merge request reports