Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1247)

Unified Diff: media/audio/sounds/sounds_manager.cc

Issue 1453233002: Improve input handling for WaveAudioHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: More comments, more test cases. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/sounds/sounds_manager.cc
diff --git a/media/audio/sounds/sounds_manager.cc b/media/audio/sounds/sounds_manager.cc
index 17f0dd874368f89c23c2aab57749e9c771b8282f..35f467b4d78dd8eeea5359620cc07c0384c5335d 100644
--- a/media/audio/sounds/sounds_manager.cc
+++ b/media/audio/sounds/sounds_manager.cc
@@ -89,8 +89,10 @@ base::TimeDelta SoundsManagerImpl::GetDuration(SoundKey key) {
return base::TimeDelta();
if (!handler->IsInitialized())
return base::TimeDelta();
- const WavAudioHandler& wav_audio = handler->wav_audio_handler();
- return wav_audio.GetDuration();
+
+ const WavAudioHandler* wav_audio = handler->wav_audio_handler();
+ DCHECK(wav_audio);
+ return wav_audio->GetDuration();
}
linked_ptr<AudioStreamHandler> SoundsManagerImpl::GetHandler(SoundKey key) {

Powered by Google App Engine
This is Rietveld 408576698