OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/composite_filter.h" | 5 #include "media/base/composite_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "media/base/callback.h" | 10 #include "media/base/callback.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 break; | 171 break; |
172 case kSeekPending: | 172 case kSeekPending: |
173 ChangeState(kStopWhileSeekPending); | 173 ChangeState(kStopWhileSeekPending); |
174 break; | 174 break; |
175 default: | 175 default: |
176 SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); | 176 SendErrorToHost(PIPELINE_ERROR_INVALID_STATE); |
177 callback->Run(); | 177 callback->Run(); |
178 return; | 178 return; |
179 } | 179 } |
180 | 180 |
| 181 if (!status_cb_.is_null()) { |
| 182 DCHECK_EQ(state_, kStopWhileSeekPending); |
| 183 status_cb_.Reset(); |
| 184 } |
| 185 |
181 callback_.reset(callback.release()); | 186 callback_.reset(callback.release()); |
| 187 |
182 if (state_ == kStopPending) { | 188 if (state_ == kStopPending) { |
183 StartSerialCallSequence(); | 189 StartSerialCallSequence(); |
184 } | 190 } |
185 } | 191 } |
186 | 192 |
187 void CompositeFilter::SetPlaybackRate(float playback_rate) { | 193 void CompositeFilter::SetPlaybackRate(float playback_rate) { |
188 DCHECK_EQ(message_loop_, MessageLoop::current()); | 194 DCHECK_EQ(message_loop_, MessageLoop::current()); |
189 for (FilterVector::iterator iter = filters_.begin(); | 195 for (FilterVector::iterator iter = filters_.begin(); |
190 iter != filters_.end(); | 196 iter != filters_.end(); |
191 ++iter) { | 197 ++iter) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 560 |
555 void CompositeFilter::FilterHostImpl::SetCurrentReadPosition(int64 offset) { | 561 void CompositeFilter::FilterHostImpl::SetCurrentReadPosition(int64 offset) { |
556 host_->SetCurrentReadPosition(offset); | 562 host_->SetCurrentReadPosition(offset); |
557 } | 563 } |
558 | 564 |
559 int64 CompositeFilter::FilterHostImpl::GetCurrentReadPosition() { | 565 int64 CompositeFilter::FilterHostImpl::GetCurrentReadPosition() { |
560 return host_->GetCurrentReadPosition(); | 566 return host_->GetCurrentReadPosition(); |
561 } | 567 } |
562 | 568 |
563 } // namespace media | 569 } // namespace media |
OLD | NEW |