Correct video quality recalculation

The video quality is incorrect when the prefer quality does not
existed.