Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_splicer.h" | 5 #include "media/base/audio_splicer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 << "us, more than threshold of +/-" | 176 << "us, more than threshold of +/-" |
| 177 << AudioSplicer::kMaxTimeDeltaInMilliseconds | 177 << AudioSplicer::kMaxTimeDeltaInMilliseconds |
| 178 << "ms. Expected timestamp is based on decoded frames and frame rate."; | 178 << "ms. Expected timestamp is based on decoded frames and frame rate."; |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| 182 int frames_to_fill = 0; | 182 int frames_to_fill = 0; |
| 183 if (!delta.is_zero()) | 183 if (!delta.is_zero()) |
| 184 frames_to_fill = output_timestamp_helper_.GetFramesToTarget(timestamp); | 184 frames_to_fill = output_timestamp_helper_.GetFramesToTarget(timestamp); |
| 185 | 185 |
| 186 if (frames_to_fill == 0 || std::abs(frames_to_fill) < kMinGapSize) { | 186 if (frames_to_fill == 0 || std::abs(frames_to_fill) < kMinGapSize || |
|
DaleCurtis
2016/11/01 23:05:13
Raw formats should just skip the sanitizer entirel
AndyWu
2016/11/04 18:04:24
Sorry, I am not sure what to do. Should I move the
chcunningham
2016/11/11 19:14:28
This whole file is now deleted. But Dale is right
AndyWu
2016/11/11 23:49:12
Thanks a lot for the well written article from Dal
| |
| 187 input->sample_format() == kSampleFormatRaw) { | |
| 187 AddOutputBuffer(input); | 188 AddOutputBuffer(input); |
| 188 return true; | 189 return true; |
| 189 } | 190 } |
| 190 | 191 |
| 191 if (frames_to_fill > 0) { | 192 if (frames_to_fill > 0) { |
| 192 LIMITED_MEDIA_LOG(DEBUG, media_log_, num_warning_logs_, | 193 LIMITED_MEDIA_LOG(DEBUG, media_log_, num_warning_logs_, |
| 193 kMaxSanitizerWarningLogs) | 194 kMaxSanitizerWarningLogs) |
| 194 << "Audio splicer inserting silence for small gap of " | 195 << "Audio splicer inserting silence for small gap of " |
| 195 << delta.InMicroseconds() << "us at time " | 196 << delta.InMicroseconds() << "us at time " |
| 196 << expected_timestamp.InMicroseconds() << "us."; | 197 << expected_timestamp.InMicroseconds() << "us."; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 551 AccurateTrimStart(frames_to_trim, remainder, output_ts_helper); | 552 AccurateTrimStart(frames_to_trim, remainder, output_ts_helper); |
| 552 CHECK(output_sanitizer_->AddInput(remainder)); | 553 CHECK(output_sanitizer_->AddInput(remainder)); |
| 553 } | 554 } |
| 554 | 555 |
| 555 // Transfer all remaining buffers out and reset once empty. | 556 // Transfer all remaining buffers out and reset once empty. |
| 556 CHECK(post_splice_sanitizer_->DrainInto(output_sanitizer_.get())); | 557 CHECK(post_splice_sanitizer_->DrainInto(output_sanitizer_.get())); |
| 557 post_splice_sanitizer_->Reset(); | 558 post_splice_sanitizer_->Reset(); |
| 558 } | 559 } |
| 559 | 560 |
| 560 } // namespace media | 561 } // namespace media |
| OLD | NEW |