Mac would force bluetooth playout working with 8kHz/1ch if capturing/rendering shares the same device, e.g. changing from 44.1kHz/2ch as default.
So in the HandleStreamFormatChange() callback, we need to re-initiate the playout as same as what we do in InitPlayout(). Here we merely copy those codes out from InitPlayout() into a new SetDesiredPlayoutFormat() function for the invoking from the two places.
Previously, HandleStreamFormatChange only re-creates the AudioConverter, which is not enough. We also need to reset the buffer size and refresh the latency.

BUG=4240
TEST=Manual Test
R=andrew@webrtc.org, henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36029004

Cr-Commit-Position: refs/heads/master@{#8815}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8815 4adac7df-926f-26a2-2b94-8c16560cd09d
2 files changed