- if (_decoded_video.empty() || (frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1))) {
- /* Either we have no decoded data, or what we do have is a long way from what we want: seek */
+ /* At this stage, if we have get_video()ed before, _decoded_video will contain the last frame that this
+ method returned (and possibly a few more). If the requested frame is not in _decoded_video and it is not the next
+ one after the end of _decoded_video we need to seek.
+ */
+
+ if (_decoded_video.empty() || frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1)) {