| 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/filters/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 if (!audio_) { | 560 if (!audio_) { |
| 561 DVLOG(1) << "Failed to create an audio stream."; | 561 DVLOG(1) << "Failed to create an audio stream."; |
| 562 return false; | 562 return false; |
| 563 } | 563 } |
| 564 | 564 |
| 565 if (!frame_processor_->AddTrack(FrameProcessorBase::kAudioTrackId, | 565 if (!frame_processor_->AddTrack(FrameProcessorBase::kAudioTrackId, |
| 566 audio_)) { | 566 audio_)) { |
| 567 DVLOG(1) << "Failed to add audio track to frame processor."; | 567 DVLOG(1) << "Failed to add audio track to frame processor."; |
| 568 return false; | 568 return false; |
| 569 } | 569 } |
| 570 } else { |
| 571 frame_processor_->clear_audio_preroll_buffer(); |
| 570 } | 572 } |
| 571 | 573 |
| 572 success &= audio_->UpdateAudioConfig(audio_config, log_cb_); | 574 success &= audio_->UpdateAudioConfig(audio_config, log_cb_); |
| 573 } | 575 } |
| 574 | 576 |
| 575 if (video_config.IsValidConfig()) { | 577 if (video_config.IsValidConfig()) { |
| 576 if (!video_) { | 578 if (!video_) { |
| 577 video_ = create_demuxer_stream_cb_.Run(DemuxerStream::VIDEO); | 579 video_ = create_demuxer_stream_cb_.Run(DemuxerStream::VIDEO); |
| 578 | 580 |
| 579 if (!video_) { | 581 if (!video_) { |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 } | 1737 } |
| 1736 | 1738 |
| 1737 void ChunkDemuxer::ShutdownAllStreams() { | 1739 void ChunkDemuxer::ShutdownAllStreams() { |
| 1738 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1740 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
| 1739 itr != source_state_map_.end(); ++itr) { | 1741 itr != source_state_map_.end(); ++itr) { |
| 1740 itr->second->Shutdown(); | 1742 itr->second->Shutdown(); |
| 1741 } | 1743 } |
| 1742 } | 1744 } |
| 1743 | 1745 |
| 1744 } // namespace media | 1746 } // namespace media |
| OLD | NEW |