If VFR movies are sequentially decoded, presentation timestamp is not
taken into consideration. This means, that frames with varying duration
will be presented at constant intervals and eventually will fall out of
sync with time at which they should be presented.
During rendering, internal state is reset which causes decoder to seek
in stream, which does consider presentation timestamp. This means that
there can be mismatch between preview and rendered image.
Check if presentation timestamp matches requested timestamp. If not,
reset decoder state, seek to keyframe and scan for requested timestamp.
This does resolve mismatch between image in preview and rendered image.
Note: This patch is essentially same as D13583, but much less efficient.
It can cause strip length to be detected incorrectly because some frames
will be displayed for longer time. Number of frames in stream is
unknown. unles they are all decoded. this is why currently timecodes are
used instead.