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

Unified Diff: media/filters/audio_clock.h

Issue 1160853006: Improve audio/video sync during underflow, reduce underflow frequency. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 5 years, 6 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 | « media/base/wall_clock_time_source_unittest.cc ('k') | media/filters/audio_clock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_clock.h
diff --git a/media/filters/audio_clock.h b/media/filters/audio_clock.h
index fe462aba5d5e55e1764ac1a49c24ae89c613f929..f7711f67fd77bb895f5c25923612487379fa5d83 100644
--- a/media/filters/audio_clock.h
+++ b/media/filters/audio_clock.h
@@ -59,6 +59,18 @@ class MEDIA_EXPORT AudioClock {
int delay_frames,
double playback_rate);
+ // If WroteAudio() calls are suspended (i.e. due to playback being paused) the
+ // AudioClock will not properly advance time (even though all data up until
+ // back_timestamp() will playout on the physical device).
+ //
+ // To compensate for this, when calls resume, before the next WroteAudio(),
+ // callers should call CompensateForSuspendedWrites() to advance the clock for
+ // audio which continued playing out while WroteAudio() calls were suspended.
+ //
+ // |delay_frames| must be provided to properly prime the clock to compensate
+ // for a new initial delay.
+ void CompensateForSuspendedWrites(base::TimeDelta elapsed, int delay_frames);
+
// Returns the bounds of media data currently buffered by the audio hardware,
// taking silence and changes in playback rate into account. Buffered audio
// structure and timestamps are updated with every call to WroteAudio().
« no previous file with comments | « media/base/wall_clock_time_source_unittest.cc ('k') | media/filters/audio_clock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698