| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // weird behavior with multichannel wav files: http://crbug.com/600538. | 546 // weird behavior with multichannel wav files: http://crbug.com/600538. |
| 547 if (!buffer->end_of_stream() && | 547 if (!buffer->end_of_stream() && |
| 548 (buffer->sample_rate() != audio_parameters_.sample_rate() || | 548 (buffer->sample_rate() != audio_parameters_.sample_rate() || |
| 549 buffer->channel_count() != audio_parameters_.channels())) { | 549 buffer->channel_count() != audio_parameters_.channels())) { |
| 550 MEDIA_LOG(ERROR, media_log_) | 550 MEDIA_LOG(ERROR, media_log_) |
| 551 << "Unsupported midstream configuration change!" | 551 << "Unsupported midstream configuration change!" |
| 552 << " Sample Rate: " << buffer->sample_rate() << " vs " | 552 << " Sample Rate: " << buffer->sample_rate() << " vs " |
| 553 << audio_parameters_.sample_rate() | 553 << audio_parameters_.sample_rate() |
| 554 << ", Channels: " << buffer->channel_count() << " vs " | 554 << ", Channels: " << buffer->channel_count() << " vs " |
| 555 << audio_parameters_.channels(); | 555 << audio_parameters_.channels(); |
| 556 HandleAbortedReadOrDecodeError(PIPELINE_ERROR_DECODE); | 556 HandleAbortedReadOrDecodeError(true); |
| 557 return; | 557 return; |
| 558 } | 558 } |
| 559 | 559 |
| 560 if (!splicer_->AddInput(buffer)) { | 560 if (!splicer_->AddInput(buffer)) { |
| 561 HandleAbortedReadOrDecodeError(true); | 561 HandleAbortedReadOrDecodeError(true); |
| 562 return; | 562 return; |
| 563 } | 563 } |
| 564 } | 564 } |
| 565 | 565 |
| 566 if (!splicer_->HasNextBuffer()) { | 566 if (!splicer_->HasNextBuffer()) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 << buffering_state; | 907 << buffering_state; |
| 908 DCHECK_NE(buffering_state_, buffering_state); | 908 DCHECK_NE(buffering_state_, buffering_state); |
| 909 lock_.AssertAcquired(); | 909 lock_.AssertAcquired(); |
| 910 buffering_state_ = buffering_state; | 910 buffering_state_ = buffering_state; |
| 911 | 911 |
| 912 task_runner_->PostTask(FROM_HERE, | 912 task_runner_->PostTask(FROM_HERE, |
| 913 base::Bind(buffering_state_cb_, buffering_state_)); | 913 base::Bind(buffering_state_cb_, buffering_state_)); |
| 914 } | 914 } |
| 915 | 915 |
| 916 } // namespace media | 916 } // namespace media |
| OLD | NEW |