Skip to content

Commit 645fece

Browse files
committed
DX9: Переделка GetNextInternalSampleInfo в GetNextInternalSurface для упрощения кода.
1 parent 9ed9995 commit 645fece

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Source/DXVA2VP.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,7 @@ IDirect3DSurface9* CDXVA2VP::GetNextInputSurface(const UINT frameNum, const DXVA
420420
}
421421
}
422422

423-
auto sample = m_VideoSamples.GetNextInternalSampleInfo(frameNum, sampleFmt, pSurface);
424-
425-
return sample ? sample->pSrcSurface.p : nullptr;
423+
return m_VideoSamples.GetNextInternalSurface(frameNum, sampleFmt, pSurface);
426424
}
427425

428426
void CDXVA2VP::CleanSamples()

Source/DXVA2VP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class VideoSampleBuffer
132132
if (m_exFmt.VideoTransferFunction > DXVA2_VideoTransFunc_28) { m_exFmt.VideoTransferFunction = DXVA2_VideoTransFunc_709; }
133133
}
134134

135-
DXVA2_SampleInfo* GetNextInternalSampleInfo(const UINT frameNum, const DXVA2_SampleFormat sampleFmt, IDirect3DSurface9* pSurface)
135+
IDirect3DSurface9* GetNextInternalSurface(const UINT frameNum, const DXVA2_SampleFormat sampleFmt, IDirect3DSurface9* pSurface)
136136
{
137137
if (!m_maxSize) {
138138
return nullptr;
@@ -154,7 +154,7 @@ class VideoSampleBuffer
154154

155155
UpdateDXVA2Samples();
156156

157-
return &sample;
157+
return sample.pSrcSurface;
158158
}
159159

160160
void AddExternalSampleInfo(IMediaSample* pSample, const UINT frameNum, const DXVA2_SampleFormat sampleFmt, IDirect3DSurface9* pSrcSurface)

0 commit comments

Comments
 (0)