diff options
-rw-r--r-- | media/audio/linux/alsa_output.cc | 6 | ||||
-rw-r--r-- | media/base/pipeline.cc | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc index 86c3999..980f6e0 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() 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) + // 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_) delay = alsa_buffer_frames_ - GetAvailableFrames(); return delay; diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index a27bfc3..4650e6e 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(time <= max_time); + DCHECK_LE(time.InMicroseconds(), max_time.InMicroseconds()); DCHECK(IsRunning()); base::AutoLock auto_lock(lock_); |