Added additional logic to switch between ave_frame_rate and r_frame_rate