Doing a quick read of the code. I think the problem is 3262e3d0. We should clear cf (inside dav1d_decode_frame_exit()), which is only done if retval != 0, but 3262e3d0 changed that to 0. Probably best to call dav1d_decode_frame_exit() with -1 or similar, and after that clear f->task_thread.retval in dav1d_flush():
diff --git a/src/lib.c b/src/lib.cindex f851f2d5..255e79ea 100644--- a/src/lib.c+++ b/src/lib.c@@ -581,12 +581,13 @@ void dav1d_flush(Dav1dContext *const c) { for (unsigned n = 0, next = c->frame_thread.next; n < c->n_fc; n++, next++) { if (next == c->n_fc) next = 0; Dav1dFrameContext *const f = &c->fc[next];- dav1d_decode_frame_exit(f, 0);+ dav1d_decode_frame_exit(f, -1); f->n_tile_data = 0; Dav1dThreadPicture *out_delayed = &c->frame_thread.out_delayed[next]; if (out_delayed->p.data[0]) { dav1d_thread_picture_unref(out_delayed); }+ f->task_thread.retval = 0; } c->frame_thread.next = 0; }
Agreed with placing this in a new bug report by the way, but from your comment, it's not clear if you bisected it to that commit. Could you clarify? And if not bisected, would it be possible to bisect? I'm going through the code ATM and don't see anything obvious yet, so any additional information would be welcome.
If you'd like to discuss in a more interactive way, IRC may be a useful way to find us. I'd really like to get to the bottom of this, so please don't let this slide. (We're not able to reproduce ATM...)
I don't see exactly what is the relation, but the 56fc43ae speeds up the seeking too.
(probably it speeds up the decoding of the first frame(s) after seeking, so the seeking was not slow, just the output frames couldn't come out between the repeated dav1d_flush callings)
Now there's no (testable) difference between the 0dc1d353 and the latest 5fb9f3a4 version at the seeking speed.
And currently I don't see any decoder/seeking issues. Thnx