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" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // If everything would be discarded, indicate a new buffer is required. | 222 // If everything would be discarded, indicate a new buffer is required. |
223 if (end_frames_to_discard == decoded_frames) | 223 if (end_frames_to_discard == decoded_frames) |
224 return false; | 224 return false; |
225 | 225 |
226 decoded_buffer->TrimEnd(end_frames_to_discard); | 226 decoded_buffer->TrimEnd(end_frames_to_discard); |
227 } | 227 } |
228 } else { | 228 } else { |
229 DCHECK(current_discard_padding.second.is_zero()); | 229 DCHECK(current_discard_padding.second.is_zero()); |
230 } | 230 } |
231 | 231 |
232 DVLOG(3) << __FUNCTION__ << " ts: " << timestamp_helper_.GetTimestamp() | 232 DVLOG(3) << __func__ << " ts: " << timestamp_helper_.GetTimestamp() |
233 << " frames: " << decoded_buffer->frame_count(); | 233 << " frames: " << decoded_buffer->frame_count(); |
234 | 234 |
235 // Assign timestamp to the buffer. | 235 // Assign timestamp to the buffer. |
236 decoded_buffer->set_timestamp(timestamp_helper_.GetTimestamp()); | 236 decoded_buffer->set_timestamp(timestamp_helper_.GetTimestamp()); |
237 timestamp_helper_.AddFrames(decoded_buffer->frame_count()); | 237 timestamp_helper_.AddFrames(decoded_buffer->frame_count()); |
238 return true; | 238 return true; |
239 } | 239 } |
240 | 240 |
241 } // namespace media | 241 } // namespace media |
OLD | NEW |