Fixed ffmpeg memory problem (faulty use of refcounted_frame)