diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:34:27 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:34:27 +0000 |
commit | ff03331621fad27ead23ddca2a218c342984a9a1 (patch) | |
tree | eae2cb7d94ed3b0bea7617f1cec61521f53cf724 /media | |
parent | 2b7b79a2570048d79f055a7eb62c02dedab8a7af (diff) | |
download | chromium_src-ff03331621fad27ead23ddca2a218c342984a9a1.zip chromium_src-ff03331621fad27ead23ddca2a218c342984a9a1.tar.gz chromium_src-ff03331621fad27ead23ddca2a218c342984a9a1.tar.bz2 |
ignore audio error and play video without audio
BUG=16023
TEST=play a multichannel audio video and it should play with audio muted
Review URL: http://codereview.chromium.org/155937
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/audio_renderer_impl.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc index f944c88..b2bbf6f 100644 --- a/media/filters/audio_renderer_impl.cc +++ b/media/filters/audio_renderer_impl.cc @@ -35,24 +35,24 @@ bool AudioRendererImpl::IsMediaFormatSupported( } void AudioRendererImpl::SetPlaybackRate(float rate) { - DCHECK(stream_); - // TODO(fbarchard): limit rate to reasonable values playback_rate_ = rate; static bool started = false; - if (rate > 0.0f && !started) + if (rate > 0.0f && !started && stream_) stream_->Start(this); } void AudioRendererImpl::SetVolume(float volume) { - stream_->SetVolume(volume, volume); + if (stream_) + stream_->SetVolume(volume, volume); } size_t AudioRendererImpl::OnMoreData(AudioOutputStream* stream, void* dest_void, size_t len) { // TODO(scherkus): handle end of stream. - DCHECK(stream_ == stream); + if (!stream_) + return 0; // TODO(scherkus): Maybe change OnMoreData to pass in char/uint8 or similar. // TODO(fbarchard): Waveout_output_win.h should handle zero length buffers @@ -91,7 +91,6 @@ bool AudioRendererImpl::OnInitialize(const MediaFormat& media_format) { if (!stream_->Open(size)) { stream_->Close(); stream_ = NULL; - return false; } return true; } |