Skip to content

Commit eb427cb

Browse files
committed
Rename map
1 parent 7a95191 commit eb427cb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Source/D3D11VideoSampleProvider.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace FFmpegInteropX
143143

144144
// Attach Processed event and store in samples list
145145
auto token = sample->Processed += ref new Windows::Foundation::TypedEventHandler<Windows::Media::Core::MediaStreamSample^, Platform::Object^>(this, &D3D11VideoSampleProvider::OnProcessed);
146-
samples[sampleNative] = token;
146+
trackedSamples[sampleNative] = token;
147147
}
148148

149149
return UncompressedVideoSampleProvider::SetSampleProperties(sample);
@@ -154,16 +154,16 @@ namespace FFmpegInteropX
154154
std::lock_guard<std::mutex> lock(samplesMutex);
155155

156156
auto sampleNative = reinterpret_cast<IUnknown*>(sender);
157-
auto mapEntry = samples.find(sampleNative);
158-
if (mapEntry == samples.end())
157+
auto mapEntry = trackedSamples.find(sampleNative);
158+
if (mapEntry == trackedSamples.end())
159159
{
160160
// sample was already released during Flush() or destructor
161161
}
162162
else
163163
{
164164
// Release the sample's native interface and return texture to pool
165165
sampleNative->Release();
166-
samples.erase(mapEntry);
166+
trackedSamples.erase(mapEntry);
167167

168168
ReturnTextureToPool(sender);
169169
}
@@ -193,7 +193,7 @@ namespace FFmpegInteropX
193193
void ReleaseTrackedSamples()
194194
{
195195
std::lock_guard<std::mutex> lock(samplesMutex);
196-
for (auto entry : samples)
196+
for (auto entry : trackedSamples)
197197
{
198198
// detach Processed event and release native interface
199199
auto sampleNative = entry.first;
@@ -203,13 +203,13 @@ namespace FFmpegInteropX
203203
sampleNative->Release();
204204
}
205205

206-
samples.clear();
206+
trackedSamples.clear();
207207
}
208208

209209
void ReturnTrackedSamples()
210210
{
211211
std::lock_guard<std::mutex> lock(samplesMutex);
212-
for (auto entry : samples)
212+
for (auto entry : trackedSamples)
213213
{
214214
// detach Processed event and release native interface
215215
auto sampleNative = entry.first;
@@ -222,7 +222,7 @@ namespace FFmpegInteropX
222222
ReturnTextureToPool(sample);
223223
}
224224

225-
samples.clear();
225+
trackedSamples.clear();
226226
}
227227

228228
virtual HRESULT SetHardwareDevice(ID3D11Device* device, ID3D11DeviceContext* context, AVBufferRef* avHardwareContext) override
@@ -453,7 +453,7 @@ namespace FFmpegInteropX
453453
}
454454

455455
TexturePool^ texturePool;
456-
std::map<IUnknown*,EventRegistrationToken> samples;
456+
std::map<IUnknown*,EventRegistrationToken> trackedSamples;
457457
std::mutex samplesMutex;
458458
};
459459
}

0 commit comments

Comments
 (0)