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/capture/video/win/filter_base_win.h" | 5 #include "media/capture/video/win/filter_base_win.h" |
6 | 6 |
7 #pragma comment(lib, "strmiids.lib") | 7 #pragma comment(lib, "strmiids.lib") |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... | |
31 | 31 |
32 STDMETHOD_(ULONG, Release)() override { | 32 STDMETHOD_(ULONG, Release)() override { |
33 base::RefCounted<PinEnumerator>::Release(); | 33 base::RefCounted<PinEnumerator>::Release(); |
34 return 1; | 34 return 1; |
35 } | 35 } |
36 | 36 |
37 // Implement IEnumPins. | 37 // Implement IEnumPins. |
38 STDMETHOD(Next)(ULONG count, IPin** pins, ULONG* fetched) override { | 38 STDMETHOD(Next)(ULONG count, IPin** pins, ULONG* fetched) override { |
39 ULONG pins_fetched = 0; | 39 ULONG pins_fetched = 0; |
40 while (pins_fetched < count && filter_->NoOfPins() > index_) { | 40 while (pins_fetched < count && filter_->NoOfPins() > index_) { |
41 IPin* pin = filter_->GetPin(index_++); | 41 index_++; |
42 IPin* pin = filter_->GetPin(static_cast<int>(index_)); | |
emircan
2016/06/21 04:54:36
This would pre-increment and cause a different beh
| |
42 pin->AddRef(); | 43 pin->AddRef(); |
43 pins[pins_fetched++] = pin; | 44 pins[pins_fetched++] = pin; |
44 } | 45 } |
45 | 46 |
46 if (fetched) | 47 if (fetched) |
47 *fetched = pins_fetched; | 48 *fetched = pins_fetched; |
48 | 49 |
49 return pins_fetched == count ? S_OK : S_FALSE; | 50 return pins_fetched == count ? S_OK : S_FALSE; |
50 } | 51 } |
51 | 52 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 | 165 |
165 ULONG STDMETHODCALLTYPE FilterBase::Release() { | 166 ULONG STDMETHODCALLTYPE FilterBase::Release() { |
166 base::RefCounted<FilterBase>::Release(); | 167 base::RefCounted<FilterBase>::Release(); |
167 return 1; | 168 return 1; |
168 } | 169 } |
169 | 170 |
170 FilterBase::~FilterBase() { | 171 FilterBase::~FilterBase() { |
171 } | 172 } |
172 | 173 |
173 } // namespace media | 174 } // namespace media |
OLD | NEW |