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/renderers/audio_renderer_impl.h" | 5 #include "media/renderers/audio_renderer_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 | 528 |
| 529 DCHECK(buffer_converter_); | 529 DCHECK(buffer_converter_); |
| 530 buffer_converter_->AddInput(buffer); | 530 buffer_converter_->AddInput(buffer); |
| 531 while (buffer_converter_->HasNextBuffer()) { | 531 while (buffer_converter_->HasNextBuffer()) { |
| 532 if (!splicer_->AddInput(buffer_converter_->GetNextBuffer())) { | 532 if (!splicer_->AddInput(buffer_converter_->GetNextBuffer())) { |
| 533 HandleAbortedReadOrDecodeError(AUDIO_RENDERER_ERROR_SPLICE_FAILED); | 533 HandleAbortedReadOrDecodeError(AUDIO_RENDERER_ERROR_SPLICE_FAILED); |
| 534 return; | 534 return; |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 } else { | 537 } else { |
| 538 // Check if the buffer we received matches the expected configuration. | |
|
DaleCurtis
2016/04/07 20:05:04
Add something like:
// TODO(chcunningham, tguilbe
tguilbert
2016/04/07 21:08:50
Done.
| |
| 539 | |
|
DaleCurtis
2016/04/07 20:05:04
No extra line.
tguilbert
2016/04/07 21:08:50
Done.
| |
| 540 if (!buffer->end_of_stream() && | |
| 541 (buffer->sample_rate() != audio_parameters_.sample_rate() || | |
| 542 buffer->channel_count() != | |
| 543 ChannelLayoutToChannelCount(audio_parameters_.channel_layout()))) { | |
|
DaleCurtis
2016/04/07 20:05:04
Just use audio_parameters_.channels() ?
tguilbert
2016/04/07 21:08:50
Oops! You are right. Done.
| |
| 544 HandleAbortedReadOrDecodeError(PIPELINE_ERROR_DECODE); | |
|
DaleCurtis
2016/04/07 20:05:04
Add a MEDIA_LOG in here, something like:
MEDIA_LO
tguilbert
2016/04/07 21:08:50
Done.
| |
| 545 } | |
| 546 | |
| 538 if (!splicer_->AddInput(buffer)) { | 547 if (!splicer_->AddInput(buffer)) { |
| 539 HandleAbortedReadOrDecodeError(AUDIO_RENDERER_ERROR_SPLICE_FAILED); | 548 HandleAbortedReadOrDecodeError(AUDIO_RENDERER_ERROR_SPLICE_FAILED); |
| 540 return; | 549 return; |
| 541 } | 550 } |
| 542 } | 551 } |
| 543 | 552 |
| 544 if (!splicer_->HasNextBuffer()) { | 553 if (!splicer_->HasNextBuffer()) { |
| 545 AttemptRead_Locked(); | 554 AttemptRead_Locked(); |
| 546 return; | 555 return; |
| 547 } | 556 } |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 881 << buffering_state; | 890 << buffering_state; |
| 882 DCHECK_NE(buffering_state_, buffering_state); | 891 DCHECK_NE(buffering_state_, buffering_state); |
| 883 lock_.AssertAcquired(); | 892 lock_.AssertAcquired(); |
| 884 buffering_state_ = buffering_state; | 893 buffering_state_ = buffering_state; |
| 885 | 894 |
| 886 task_runner_->PostTask(FROM_HERE, | 895 task_runner_->PostTask(FROM_HERE, |
| 887 base::Bind(buffering_state_cb_, buffering_state_)); | 896 base::Bind(buffering_state_cb_, buffering_state_)); |
| 888 } | 897 } |
| 889 | 898 |
| 890 } // namespace media | 899 } // namespace media |
| OLD | NEW |