A buffer-based approach to video rate adaptation