Do not start AGC timer if getting max volume is not supported by stream
When audio stream do not support GetMaxVolume(), it will be spam to query and update normalized volume every second, especially making unsupported GetMaxVolume() print out warning msg. In this change, if the first try to get |max_volume_| fails, |normalized_volume_| won't be set and timer will not be started. This CL assumes that if GetMaxVolume() doesn't work at first, it will not work all the time during the stream; and user may StartAgc() again once the GetMaxVolume() start to work after a while. Other behavior should have no difference. Google Home, no longer have spamming warning msg, and work well. Bug: NONE Test: Build on desktop and test on appr.tc, no crash; built and run on Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: Ic4af961df08cb4f1940604c44108ca08e80190c8 Reviewed-on: https://chromium-review.googlesource.com/954584Reviewed-by:Olga Sharonova <olka@chromium.org> Reviewed-by:
Max Morin <maxmorin@chromium.org> Commit-Queue: Olga Sharonova <olka@chromium.org> Cr-Commit-Position: refs/heads/master@{#548041}
Showing
Please register or sign in to comment