On Tue, 8 Jul 2025, Devin Heitmueller wrote:
On Tue, Jul 8, 2025 at 1:08 PM Marvin Scholz
<epirat07-at-gmail....@ffmpeg.org> wrote:
What about a drain_timeout option? This could then solve all the
mentioned cases. We could have it default to something like 1000ms,
and for your use-case you could set it to 0, to not drain at all?
I have no objection to that approach.
Ok, but instead of sleeping you should use something like this:
pthread_mutex_lock(&ctx->mutex);
while (ctx->frames_buffer_available_spots < ctx->frame_buffer) {
pthread_cond_wait(&ctx->cond, &ctx->mutex);
}
pthread_mutex_unlock(&ctx->mutex);
If you want an adjustable timeout you can use pthread_cond_timedwait().
Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".