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

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

Issue 2342913002: [Chromecast] Don't DCHECK the result of snd_pcm_status_get_avail (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5f4b3e242dba708faca54239b5c517c4d7ebe71d..6dc259bfdea89b368002d47b81013ea256654dd4 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
@@ -764,6 +764,8 @@ bool StreamMixerAlsa::TryWriteFrames() {
return false;
}
+ const int min_frames_in_buffer =
+ output_samples_per_second_ * kMinBufferedDataMs / 1000;
int chunk_size = output_samples_per_second_ * kMaxWriteSizeMs / 1000;
std::vector<InputQueue*> active_inputs;
for (auto&& input : inputs_) {
@@ -777,11 +779,8 @@ bool StreamMixerAlsa::TryWriteFrames() {
return false;
}
- const int min_frames_in_buffer =
- output_samples_per_second_ * kMinBufferedDataMs / 1000;
int frames_in_buffer =
alsa_buffer_size_ - alsa_->PcmStatusGetAvail(pcm_status_);
- DCHECK_GE(frames_in_buffer, 0);
if (alsa_->PcmStatusGetState(pcm_status_) == SND_PCM_STATE_XRUN ||
frames_in_buffer < min_frames_in_buffer) {
// If there has been (or soon will be) an underrun, continue without the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698