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

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

Issue 2344993003: [Chromecast] Fade in after a mixer input stream has skipped (Closed)
Patch Set: Created 4 years, 3 months 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.cc
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
index 6dc259bfdea89b368002d47b81013ea256654dd4..d22e417e88a3160649394a4a4a6a1950919fd910 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
@@ -785,6 +785,7 @@ bool StreamMixerAlsa::TryWriteFrames() {
frames_in_buffer < min_frames_in_buffer) {
// If there has been (or soon will be) an underrun, continue without the
// empty primary input stream.
+ input->OnSkipped();
continue;
}
@@ -793,16 +794,13 @@ bool StreamMixerAlsa::TryWriteFrames() {
FROM_HERE, base::TimeDelta::FromMilliseconds(kMinBufferedDataMs / 2),
base::Bind(&StreamMixerAlsa::WriteFrames, base::Unretained(this)));
return false;
+ } else {
+ input->OnSkipped();
}
}
if (active_inputs.empty()) {
- // No inputs have any data to provide.
- if (!inputs_.empty()) {
- return false; // If there are some inputs, don't fill with silence.
- }
-
- // If we have no inputs, fill with silence to avoid underrun.
+ // No inputs have any data to provide. Fill with silence to avoid underrun.
chunk_size = kPreventUnderrunChunkSize;
if (!mixed_ || mixed_->frames() < chunk_size) {
mixed_ = ::media::AudioBus::Create(kNumOutputChannels, chunk_size);

Powered by Google App Engine
This is Rietveld 408576698