Fix problem with video codec opened before last one is closed in continous playback

Refs #1860