playerendpoint: Send flush events only when they are needed

Change-Id: I32429ec2e01da6aa42ad00bcc5ef717f2d15ca12