diff options
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c index 90cb0e4..be9320e 100644 --- a/src/decode.c +++ b/src/decode.c @@ -3508,10 +3508,13 @@ int dav1d_submit_frame(Dav1dContext *const c) { &c->task_thread.lock); out_delayed = &c->frame_thread.out_delayed[next]; if (out_delayed->p.data[0] || atomic_load(&f->task_thread.error)) { - if (atomic_load(&c->task_thread.first) + 1U < c->n_fc) + unsigned first = atomic_load(&c->task_thread.first); + if (first + 1U < c->n_fc) atomic_fetch_add(&c->task_thread.first, 1U); else atomic_store(&c->task_thread.first, 0); + atomic_compare_exchange_strong(&c->task_thread.reset_task_cur, + &first, UINT_MAX); if (c->task_thread.cur && c->task_thread.cur < c->n_fc) c->task_thread.cur--; } |