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

Unified Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc

Issue 2557513002: [Chromecast] Add support for different playback rates to ALSA backend (Closed)
Patch Set: use CreateEmptyBuffer Created 4 years 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: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc
index 62332edb9f611744f21eee147b19ee14738d29a1..6df49ef5e834d9f46b19ac4852b875559fd53506 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc
@@ -83,6 +83,7 @@ StreamMixerAlsaInputImpl::StreamMixerAlsaInputImpl(
fade_frames_remaining_(0),
fade_out_frames_total_(0),
zeroed_frames_(0),
+ is_underflowing_(false),
weak_factory_(this) {
LOG(INFO) << "Create " << this;
DCHECK(delegate_);
@@ -237,6 +238,10 @@ void StreamMixerAlsaInputImpl::DidQueueData(bool end_of_stream) {
void StreamMixerAlsaInputImpl::OnSkipped() {
DCHECK(mixer_task_runner_->BelongsToCurrentThread());
+ if (!is_underflowing_) {
+ LOG(WARNING) << "Underflow for " << this;
+ is_underflowing_ = true;
+ }
if (state_ == kStateNormalPlayback) {
// Fade in once this input starts providing data again.
fade_frames_remaining_ = NormalFadeFrames();
@@ -316,6 +321,7 @@ void StreamMixerAlsaInputImpl::GetResampledData(::media::AudioBus* dest,
DCHECK(dest);
DCHECK_EQ(kNumOutputChannels, dest->channels());
DCHECK_GE(dest->frames(), frames);
+ is_underflowing_ = false;
if (state_ == kStatePaused || state_ == kStateDeleted) {
dest->ZeroFramesPartial(0, frames);

Powered by Google App Engine
This is Rietveld 408576698