[FFmpeg-devel] [PATCH 2/5] libavdevice/avfoundation.m: Replace mutex-based concurrency by a thread-safe fifo queue with maximum length

Romain Beauxis toots at rastageeks.org
Wed Jan 19 16:35:33 EET 2022


The existing implementation of avdevice input has issues in its concurrent model as it only allows for one shared frame between writing and reading threads. This means that, if reading thread gets late, frames get dropped, resulting in corrupted input.

This patch changes the concurrency logic to use a single shared queue for both video and audio frames. Previous version of the patch used separate queues for audio and video but this could cause synchronization issues.

In order to avoid dropping initial audio frames, the video configuration logic is also changed to assume height/width as configured when opening the input device so as to not depend on the first video frame for it.

-------------- next part --------------
An embedded message was scrubbed...
From: unknown sender
Subject: no subject
Date: no date
Size: 25398
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220119/ae4ab443/attachment.eml>


More information about the ffmpeg-devel mailing list