summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-04 20:18:41 +0000
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-04 20:18:41 +0000
commit7c9907b36fc39da0070ed3d6cb80b968d34785a9 (patch)
tree9dd257372553e0a71a2ad60871b2fe913fdc43d1
parentf7fa6117a38f5e2710d7d519a0414d31e17dcfd3 (diff)
downloadchromium_src-7c9907b36fc39da0070ed3d6cb80b968d34785a9.zip
chromium_src-7c9907b36fc39da0070ed3d6cb80b968d34785a9.tar.gz
chromium_src-7c9907b36fc39da0070ed3d6cb80b968d34785a9.tar.bz2
Add some additional CHECKs for splicer behavior.
Replaces a null pointer exception with a CHECK() failure and adds some additional verification for the first post splice buffer. BUG=356073,369204 TEST=tests still pass. TBR=acolwell Review URL: https://codereview.chromium.org/264973010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268124 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--media/base/audio_splicer.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/base/audio_splicer.cc b/media/base/audio_splicer.cc
index 9fae417..2fb4180 100644
--- a/media/base/audio_splicer.cc
+++ b/media/base/audio_splicer.cc
@@ -289,7 +289,7 @@ bool AudioSplicer::AddInput(const scoped_refptr<AudioBuffer>& input) {
// The first post splice buffer is expected to match |splice_timestamp_|.
if (!post_splice_sanitizer_->HasNextBuffer())
- DCHECK(splice_timestamp_ == input->timestamp());
+ CHECK(splice_timestamp_ == input->timestamp());
// At this point we have all the fade out preroll buffers from the decoder.
// We now need to wait until we have enough data to perform the crossfade (or
@@ -434,6 +434,12 @@ scoped_ptr<AudioBus> AudioSplicer::ExtractCrossfadeFromPreSplice(
}
}
+ // Ensure outputs were properly allocated. The method should not have been
+ // called if there is not enough data to crossfade.
+ // TODO(dalecurtis): Convert to DCHECK() once http://crbug.com/356073 fixed.
+ CHECK(output_bus);
+ CHECK(*crossfade_buffer);
+
// All necessary buffers have been processed, it's safe to reset.
pre_splice_sanitizer_->Reset();
DCHECK_EQ(output_bus->frames(), frames_read);