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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 } | 1125 } |
1126 | 1126 |
1127 void ChunkDemuxer::Initialize( | 1127 void ChunkDemuxer::Initialize( |
1128 DemuxerHost* host, | 1128 DemuxerHost* host, |
1129 const PipelineStatusCB& cb, | 1129 const PipelineStatusCB& cb, |
1130 bool enable_text_tracks) { | 1130 bool enable_text_tracks) { |
1131 DVLOG(1) << "Init()"; | 1131 DVLOG(1) << "Init()"; |
1132 | 1132 |
1133 base::AutoLock auto_lock(lock_); | 1133 base::AutoLock auto_lock(lock_); |
1134 | 1134 |
| 1135 // The |init_cb_| must only be run after this method returns, so always post. |
1135 init_cb_ = BindToCurrentLoop(cb); | 1136 init_cb_ = BindToCurrentLoop(cb); |
1136 if (state_ == SHUTDOWN) { | 1137 if (state_ == SHUTDOWN) { |
1137 base::ResetAndReturn(&init_cb_).Run(DEMUXER_ERROR_COULD_NOT_OPEN); | 1138 base::ResetAndReturn(&init_cb_).Run(DEMUXER_ERROR_COULD_NOT_OPEN); |
1138 return; | 1139 return; |
1139 } | 1140 } |
1140 DCHECK_EQ(state_, WAITING_FOR_INIT); | 1141 DCHECK_EQ(state_, WAITING_FOR_INIT); |
1141 host_ = host; | 1142 host_ = host; |
1142 enable_text_ = enable_text_tracks; | 1143 enable_text_ = enable_text_tracks; |
1143 | 1144 |
1144 ChangeState_Locked(INITIALIZING); | 1145 ChangeState_Locked(INITIALIZING); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 } | 1853 } |
1853 | 1854 |
1854 void ChunkDemuxer::ShutdownAllStreams() { | 1855 void ChunkDemuxer::ShutdownAllStreams() { |
1855 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1856 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1856 itr != source_state_map_.end(); ++itr) { | 1857 itr != source_state_map_.end(); ++itr) { |
1857 itr->second->Shutdown(); | 1858 itr->second->Shutdown(); |
1858 } | 1859 } |
1859 } | 1860 } |
1860 | 1861 |
1861 } // namespace media | 1862 } // namespace media |
OLD | NEW |