<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 28 Sept 2021 at 16:36, David Plowman <<a href="mailto:david.plowman@raspberrypi.com">david.plowman@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This fixes bug <a href="https://bugs.libcamera.org/show_bug.cgi?id=74" rel="noreferrer" target="_blank">https://bugs.libcamera.org/show_bug.cgi?id=74</a>.<br>
<br>
The cause is that we read out delayed values using a frame's sequence<br>
number (DelayedControls::get). But we fill the values up<br>
(DelayedControls::applyControls) incrementing writeCount by only one<br>
even if the sequence number has jumped by several since last<br>
time. This is exactly what happens when frames are being dropped.<br>
<br>
So the fix is to increment writeCount by "as much as the sequence<br>
number has jumped since last time", which means that we just follow<br>
the sequence number directly.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div>Tested-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/libcamera/delayed_controls.cpp | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp<br>
index 90ce7e0b..9667187e 100644<br>
--- a/src/libcamera/delayed_controls.cpp<br>
+++ b/src/libcamera/delayed_controls.cpp<br>
@@ -279,7 +279,7 @@ void DelayedControls::applyControls(uint32_t sequence)<br>
                }<br>
        }<br>
<br>
-       writeCount_++;<br>
+       writeCount_ = sequence - firstSequence_ + 1;<br>
<br>
        while (writeCount_ > queueCount_) {<br>
                LOG(DelayedControls, Debug)<br>
-- <br>
2.20.1<br>
<br>
</blockquote></div></div>