fix read_data_from_file function which produce errors to get frames from files with moov atom at the end, or to get last frames from videos
avoid decode the video if the requested time is very close to the end of the video