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

Unified Diff: content/browser/media/media_internals.cc

Issue 1236543007: MSE: Log buffered audio splice generation to media-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | content/browser/resources/media/main.js » ('j') | content/browser/resources/media/main.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index 4b4d6cd6b3d3cb4e415a97c43fa0bc93e10a97f2..f9d15bf9037de730139695fd4d03ec43cc578cfc 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -641,6 +641,22 @@ void MediaInternals::SaveEvent(int process_id,
}
auto& pending_events = pending_events_map_[process_id];
+
+ // Only save the most recent audio splicer statistics, if any. If the new
+ // event updates the statistics, then remove at most one previously saved
+ // statistics event.
+ if (event.type ==
+ media::MediaLogEvent::BUFFERED_AUDIO_SPLICE_STATISTICS_CHANGED) {
+ for (auto iter = pending_events.begin(); iter != pending_events.end();
wolenetz 2015/07/14 23:23:37 This isn't a very efficient mechanism for enforcin
DaleCurtis 2015/07/14 23:37:47 I think you want to do something similar to what R
xhwang 2015/07/15 00:46:50 Maybe it's time to drop all DEBUG logs when the UI
+ ++iter) {
+ if (iter->type ==
+ media::MediaLogEvent::BUFFERED_AUDIO_SPLICE_STATISTICS_CHANGED) {
+ pending_events.erase(iter);
+ break;
+ }
+ }
+ }
+
// TODO(xhwang): Notify user that some old logs could have been truncated.
// See http://crbug.com/498520
if (pending_events.size() >= kMaxNumEvents)
« no previous file with comments | « no previous file | content/browser/resources/media/main.js » ('j') | content/browser/resources/media/main.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698