This logic should be improved. It should find the last frame in the queue for which the time has passed or if non exist, the first in queue.

ie if clock is 5

If queue looks like:
2
4 <-- this should be selected
6
8

If queue looks like:
6 <-- this should be selected
8
10

That way it will auto drop really late frames.