Fix first image loss when using the RPC to save the data#1012
Merged
GiulioRomualdi merged 10 commits intomasterfrom Nov 27, 2025
Merged
Fix first image loss when using the RPC to save the data#1012GiulioRomualdi merged 10 commits intomasterfrom
GiulioRomualdi merged 10 commits intomasterfrom
Conversation
Collaborator
Author
|
While looking at the code, I realized the reason why we were not able to log the first data point on the action interface (that is using |
f6cba5a to
04586f6
Compare
77efcea to
52f9709
Compare
…hat the video threads stop when necessary
The timestamp is saved anyway
This is to avoid resorting on the lock of the mutex and avoid warnings on the duration of the run loop when saving
52f9709 to
4c9cc48
Compare
Collaborator
|
Hi @S-Dafarra can I proceed with this? |
Collaborator
Author
Yes! |
Collaborator
Author
|
I had rebased on top of #1019 yesterday, let me know if you want me to rebase on top of master |
GiulioRomualdi
approved these changes
Nov 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is on top of #1011
This PR fixes a nasty bug introduced in #1002. I was using a single mutex to block all the videos. Beside the fact that this was also making the video threads blocking each other, the logic to reset the frame index was done before locking the mutex. This means that the threads blocked while saving the data would update the frame index only starting from the second frame. The first frame would either be overwritten when reaching again the previous index number, or it would appear as last.
In this PR, I exploited a separate variable to request the video thread to pause, and I wait until everyone is paused.
Moreover, I switched from saving the frame timestamp, to the saving of the index. The timestamp was already saved anyway.
cc @giotherobot @carloscp3009