summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 02:30:08 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 02:30:08 +0000
commitccd50d5c6ce8362c86882caba06d3ac7aaaeee92 (patch)
tree7602a5fe8702639ff3ce5e4cd2578dab614b631a /media
parentfe1f67a971a68ef59e2e521397bec0df27cdcdf5 (diff)
downloadchromium_src-ccd50d5c6ce8362c86882caba06d3ac7aaaeee92.zip
chromium_src-ccd50d5c6ce8362c86882caba06d3ac7aaaeee92.tar.gz
chromium_src-ccd50d5c6ce8362c86882caba06d3ac7aaaeee92.tar.bz2
Revert 152919 - Guard against ALSA returning insane frame counts for current delay.
One video observed generated an alleged delay of 9222246136947932171 frames near the end of stream, which when converted to bytes and passed through a chain of uint32/int32 conversions became -4052 bytes, and then -46ms, triggering the DCHECK in the bug below. BUG=144281 Review URL: https://chromiumcodereview.appspot.com/10869019 TBR=fischman@chromium.org Review URL: https://chromiumcodereview.appspot.com/10879027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/audio/linux/alsa_output.cc6
-rw-r--r--media/base/pipeline.cc2
2 files changed, 4 insertions, 4 deletions
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc
index 980f6e0..86c3999 100644
--- a/media/audio/linux/alsa_output.cc
+++ b/media/audio/linux/alsa_output.cc
@@ -637,9 +637,9 @@ snd_pcm_sframes_t AlsaPcmOutputStream::GetCurrentDelay() {
}
}
- // snd_pcm_delay() sometimes returns crazy values. In this case return delay
- // of data we know currently is in ALSA's buffer.
- if (delay < 0 || delay > alsa_buffer_frames_)
+ // snd_pcm_delay() may not work in the beginning of the stream. In this case
+ // return delay of data we know currently is in the ALSA's buffer.
+ if (delay < 0)
delay = alsa_buffer_frames_ - GetAvailableFrames();
return delay;
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 4650e6e..a27bfc3 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -352,7 +352,7 @@ void Pipeline::OnAudioDisabled() {
}
void Pipeline::OnAudioTimeUpdate(TimeDelta time, TimeDelta max_time) {
- DCHECK_LE(time.InMicroseconds(), max_time.InMicroseconds());
+ DCHECK(time <= max_time);
DCHECK(IsRunning());
base::AutoLock auto_lock(lock_);