fixed bugs in ffmpeg_reader, refactorized reinit and init.