Chromium Code Reviews| Index: media/blink/webaudiosourceprovider_impl.cc |
| diff --git a/media/blink/webaudiosourceprovider_impl.cc b/media/blink/webaudiosourceprovider_impl.cc |
| index 4cace4314b4203352d45914770eafa38930597a3..2fb21392b414eeb023f9f62ffa07b5ecd5fe8501 100644 |
| --- a/media/blink/webaudiosourceprovider_impl.cc |
| +++ b/media/blink/webaudiosourceprovider_impl.cc |
| @@ -252,10 +252,22 @@ bool WebAudioSourceProviderImpl::SetVolume(double volume) { |
| return true; |
| } |
| -OutputDeviceInfo WebAudioSourceProviderImpl::GetOutputDeviceInfo() { |
| +OutputDeviceInfo WebAudioSourceProviderImpl::GetOutputDeviceInfo( |
| + const AudioParameters& preferred_params) { |
| base::AutoLock auto_lock(sink_lock_); |
| - return sink_ ? sink_->GetOutputDeviceInfo() |
| - : OutputDeviceInfo(OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND); |
| + |
| + OutputDeviceInfo sink_info = sink_->GetOutputDeviceInfo(); |
|
o1ka
2017/04/26 14:27:54
What if |sink_| is nullptr?
flim-chromium
2017/04/26 16:24:09
Fixed, thanks for spotting this!
|
| + |
| + if (client_) { |
| + return OutputDeviceInfo(sink_info.device_id(), sink_info.device_status(), |
| + preferred_params); |
| + } |
| + |
| + if (sink_) { |
| + return sink_info; |
| + } |
| + |
| + return OutputDeviceInfo(OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND); |
| } |
| bool WebAudioSourceProviderImpl::CurrentThreadIsRenderingThread() { |