OLD | NEW |
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/base/audio_discard_helper.h" | 5 #include "media/base/audio_discard_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "media/base/audio_buffer.h" | 10 #include "media/base/audio_buffer.h" |
11 #include "media/base/buffers.h" | |
12 | 11 |
13 namespace media { | 12 namespace media { |
14 | 13 |
15 static void WarnOnNonMonotonicTimestamps(base::TimeDelta last_timestamp, | 14 static void WarnOnNonMonotonicTimestamps(base::TimeDelta last_timestamp, |
16 base::TimeDelta current_timestamp) { | 15 base::TimeDelta current_timestamp) { |
17 if (last_timestamp == kNoTimestamp() || last_timestamp < current_timestamp) | 16 if (last_timestamp == kNoTimestamp() || last_timestamp < current_timestamp) |
18 return; | 17 return; |
19 | 18 |
20 const base::TimeDelta diff = current_timestamp - last_timestamp; | 19 const base::TimeDelta diff = current_timestamp - last_timestamp; |
21 DLOG(WARNING) << "Input timestamps are not monotonically increasing! " | 20 DLOG(WARNING) << "Input timestamps are not monotonically increasing! " |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 DCHECK(current_discard_padding.second == base::TimeDelta()); | 232 DCHECK(current_discard_padding.second == base::TimeDelta()); |
234 } | 233 } |
235 | 234 |
236 // Assign timestamp to the buffer. | 235 // Assign timestamp to the buffer. |
237 decoded_buffer->set_timestamp(timestamp_helper_.GetTimestamp()); | 236 decoded_buffer->set_timestamp(timestamp_helper_.GetTimestamp()); |
238 timestamp_helper_.AddFrames(decoded_buffer->frame_count()); | 237 timestamp_helper_.AddFrames(decoded_buffer->frame_count()); |
239 return true; | 238 return true; |
240 } | 239 } |
241 | 240 |
242 } // namespace media | 241 } // namespace media |
OLD | NEW |