Are you doing this? After Step 0), if frame 0 is missing, then the expected frame counter for the next frame should be 2, not 1. At Step 0) the actual frame counter is 1, so the next expected frame would be 2 (real frame counter + 1), not 1 as you say in Step 1).6) Set "expectedFrameCounter" to the value returned by processLine + 1 and continue.
You have also made an error starting with Step 1) about what value the missing frame should have. In Step 0), frame 0 is the missing one, frame 1 was found instead. In Step 1), you should be looking for frame 2, since that should be the next one after the frame that was found in the previous step. Instead, you ask "missing frame 1?" which is wrong. It should be "missing frame 2?" and the answer is NO.
If you had implemented the algorithm correctly, the results would be:
Step 0) expected frame_counter: 0, real frame_counter 1 -> missing frame 0? YES, Your algorithm says YES <= OK
Step 1) expected frame_counter: 2, real frame_counter 2 -> missing frame 2? NO, Your algorithm says NO
Step 2) expected frame_counter: 3, real frame_counter 3 -> missing frame 3? NO, Your algorithm says NO
Step 3) expected frame_counter: 4, real frame_counter 4 -> missing frame 4? NO, Your algorithm says NO
Step 4) expected frame_counter: 5, real frame_counter 5 -> missing frame 5? NO, Your algorithm says NO
Step 5) expected frame_counter: 6, real frame_counter 6 -> missing frame 6? NO, Your algorithm says NO
Step 6) expected frame_counter: 7, real frame_counter 7 -> missing frame 7? NO, Your algorithm says NO
Step 7) expected frame_counter: 8, real frame_counter 8 -> missing frame 8? NO, Your algorithm says NO
Step 8) expected frame_counter: 9, real frame_counter 10 -> missing frame 9? YES, Your algorithm says YES <= ok
Step 9) expected frame_counter: 11, real frame_counter 11 -> missing frame 11? NO, Your algorithm says NO
Bookmarks