This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 986bab2b47 avcodec/pthread_frame: stop draining after thread context
update failure
986bab2b47 is described below
commit 986bab2b47540c3d45d1299a40a3b103b344323c
Author: Michael Niedermayer <[email protected]>
AuthorDate: Sun Nov 1 20:17:44 2026 +0000
Commit: michaelni <[email protected]>
CommitDate: Thu Nov 12 14:05:30 2026 +0000
avcodec/pthread_frame: stop draining after thread context update failure
A failed update_thread_context() leaves the worker indices unchanged.
During draining, repeated receive_frame() calls then retry the same
empty packet indefinitely. Mark draining complete after reporting the
error once, and return EOF on subsequent calls.
Fixes: #25626
Reported-by: waroad
Assisted-by: Fairy
---
libavcodec/pthread_frame.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 8e88dda2ce..5b1d1f58f6 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -529,6 +529,10 @@ static int submit_packet(PerThreadContext *p,
AVCodecContext *user_avctx,
(codec->capabilities & AV_CODEC_CAP_DELAY)) {
ret = update_context_from_thread(p->avctx, prev_thread->avctx, 0);
if (ret) {
+ /* No packet was submitted and the thread indices did not
advance,
+ * so retrying the drain packet can repeat this error forever.
*/
+ if (user_avctx->internal->draining)
+ user_avctx->internal->draining_done = 1;
pthread_mutex_unlock(&p->mutex);
return ret;
}
@@ -562,6 +566,11 @@ int ff_thread_receive_frame(AVCodecContext *avctx, AVFrame
*frame, unsigned flag
* go forward while we are in this function */
async_unlock(fctx);
+ if (avctx->internal->draining_done) {
+ ret = AVERROR_EOF;
+ goto finish;
+ }
+
/* submit packets to threads while there are no buffered results to return
*/
while (!fctx->df.nb_f && !fctx->result) {
PerThreadContext *p;
--
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]