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

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

Issue 1809203003: [Chromecast] Improve rendering delay accuracy by tracking partial samples (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 9 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 | « chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h ('k') | 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_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 041ae4a160db9b56ab718015e338cc1ef6a721f2..a1f924b64eb65260ea240b4bef1ba03ff42a82e9 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
@@ -147,7 +147,8 @@ void StreamMixerAlsaInputImpl::PrepareToDelete(
fade_frames_remaining_ = queued_frames_including_resampler_;
} else if (state_ == kStateNormalPlayback) {
fade_out_frames_total_ =
- std::min(queued_frames_including_resampler_, NormalFadeFrames());
+ std::min(static_cast<int>(queued_frames_including_resampler_),
+ NormalFadeFrames());
fade_frames_remaining_ = fade_out_frames_total_;
}
}
@@ -199,9 +200,9 @@ MediaPipelineBackendAlsa::RenderingDelay StreamMixerAlsaInputImpl::QueueData(
}
MediaPipelineBackendAlsa::RenderingDelay delay = mixer_rendering_delay_;
- delay.delay_microseconds +=
- static_cast<int64_t>(queued_frames_including_resampler_) *
- base::Time::kMicrosecondsPerSecond / input_samples_per_second_;
+ delay.delay_microseconds += static_cast<int64_t>(
+ queued_frames_including_resampler_ * base::Time::kMicrosecondsPerSecond /
+ input_samples_per_second_);
return delay;
}
@@ -226,7 +227,8 @@ void StreamMixerAlsaInputImpl::DidQueueData(bool end_of_stream) {
void StreamMixerAlsaInputImpl::AfterWriteFrames(
const MediaPipelineBackendAlsa::RenderingDelay& mixer_rendering_delay) {
DCHECK(mixer_task_runner_->BelongsToCurrentThread());
- int resampler_queued_frames = (resampler_ ? resampler_->BufferedFrames() : 0);
+ double resampler_queued_frames =
+ (resampler_ ? resampler_->BufferedFrames() : 0);
bool queued_more_data = false;
MediaPipelineBackendAlsa::RenderingDelay total_delay;
@@ -267,7 +269,8 @@ int StreamMixerAlsaInputImpl::MaxReadSize() {
{
base::AutoLock lock(queue_lock_);
if (state_ == kStateGotEos)
- return std::max(queued_frames_including_resampler_, kDefaultReadSize);
+ return std::max(static_cast<int>(queued_frames_including_resampler_),
+ kDefaultReadSize);
queued_frames = queued_frames_;
}
« no previous file with comments | « chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698