From: Marton Balint <cus@passwd.hu>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Playout to DeckLink will wait for all buffered frames before stopping.
Date: Tue, 8 Jul 2025 22:11:53 +0200 (CEST)
Message-ID: <e016ba56-c4d7-5d44-3e8d-b56a1571b0d5@passwd.hu> (raw)
In-Reply-To: <CAHGibzELG7N3FFXnQxMy+WsA6tfKXQvLhejnq27vc+G4tVLGaA@mail.gmail.com>
On Tue, 8 Jul 2025, Devin Heitmueller wrote:
> On Tue, Jul 8, 2025 at 1:08 PM Marvin Scholz
> <epirat07-at-gmail.com@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-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2025-07-08 20:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 1:39 Matt via ffmpeg-devel
2025-07-08 14:54 ` Devin Heitmueller
2025-07-08 15:19 ` Marvin Scholz
2025-07-08 16:22 ` Devin Heitmueller
2025-07-08 17:08 ` Marvin Scholz
2025-07-08 17:13 ` Devin Heitmueller
2025-07-08 20:11 ` Marton Balint [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e016ba56-c4d7-5d44-3e8d-b56a1571b0d5@passwd.hu \
--to=cus@passwd.hu \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git