better r_frame_rate guessing code