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

Side by Side Diff: media/filters/decoder_stream_traits.cc

Issue 2614583002: Fix Media.Video.KeyFrameDistance metric calculation (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/decoder_stream_traits.h" 5 #include "media/filters/decoder_stream_traits.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "media/base/audio_buffer.h" 9 #include "media/base/audio_buffer.h"
10 #include "media/base/audio_decoder.h" 10 #include "media/base/audio_decoder.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (buffer->end_of_stream()) { 130 if (buffer->end_of_stream()) {
131 last_keyframe_timestamp_ = base::TimeDelta(); 131 last_keyframe_timestamp_ = base::TimeDelta();
132 return; 132 return;
133 } 133 }
134 134
135 if (!buffer->is_key_frame()) 135 if (!buffer->is_key_frame())
136 return; 136 return;
137 137
138 base::TimeDelta current_frame_timestamp = buffer->timestamp(); 138 base::TimeDelta current_frame_timestamp = buffer->timestamp();
139 if (last_keyframe_timestamp_.is_zero()) { 139 if (last_keyframe_timestamp_.is_zero()) {
140 last_keyframe_timestamp_ = current_frame_timestamp; 140 last_keyframe_timestamp_ = current_frame_timestamp;
sandersd (OOO until July 31) 2017/01/03 23:41:41 Looks like this should just not be conditional her
whywhat 2017/01/04 01:00:14 You mean something like: if (!last_kf_ts_.is_zero
141 return; 141 return;
142 } 142 }
143 143
144 UMA_HISTOGRAM_MEDIUM_TIMES( 144 UMA_HISTOGRAM_MEDIUM_TIMES(
145 "Media.Video.KeyFrameDistance", 145 "Media.Video.KeyFrameDistance",
146 current_frame_timestamp - last_keyframe_timestamp_); 146 current_frame_timestamp - last_keyframe_timestamp_);
147 last_keyframe_timestamp_ = current_frame_timestamp;
147 } 148 }
148 149
149 } // namespace media 150 } // namespace media
OLDNEW
« 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