[vlc-commits] d3d11_filters: fix adjust output when all values are default
Steve Lhomme
git at videolan.org
Thu Nov 23 09:58:58 CET 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Nov 22 18:18:27 2017 +0100| [2357637e2e52e3f702fa8173ffd8ac4a89bab676] | committer: Jean-Baptiste Kempf
d3d11_filters: fix adjust output when all values are default
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2357637e2e52e3f702fa8173ffd8ac4a89bab676
---
modules/hw/d3d11/d3d11_adjust.c | 41 +++++++++++++++++++++++++++++++++--------
1 file changed, 33 insertions(+), 8 deletions(-)
diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c
index c954c79c08..1c4aca64fb 100644
--- a/modules/hw/d3d11/d3d11_adjust.c
+++ b/modules/hw/d3d11/d3d11_adjust.c
@@ -243,35 +243,60 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic)
p_sys->procOutput[1]
};
- size_t idx = 0;
+ size_t idx = 0, count = 0;
/* contrast */
if ( ApplyFilter( p_sys,
D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, &p_sys->Contrast,
inputs[idx], outputs[idx] ) )
+ {
idx++;
+ count++;
+ }
/* brightness */
if ( ApplyFilter( p_sys,
D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS, &p_sys->Brightness,
inputs[idx], outputs[idx] ) )
+ {
idx++;
+ count++;
+ }
/* hue */
if ( ApplyFilter( p_sys,
D3D11_VIDEO_PROCESSOR_FILTER_HUE, &p_sys->Hue,
inputs[idx], outputs[idx] ) )
+ {
idx++;
+ count++;
+ }
/* saturation */
if ( ApplyFilter( p_sys,
D3D11_VIDEO_PROCESSOR_FILTER_SATURATION, &p_sys->Saturation,
inputs[idx], outputs[idx] ) )
+ {
idx++;
+ count++;
+ }
- ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context,
- p_outpic->p_sys->resource[KNOWN_DXGI_INDEX],
- p_outpic->p_sys->slice_index,
- 0, 0, 0,
- p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource,
- 0,
- NULL);
+ if (count == 0)
+ {
+ ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context,
+ p_outpic->p_sys->resource[KNOWN_DXGI_INDEX],
+ p_outpic->p_sys->slice_index,
+ 0, 0, 0,
+ p_src_sys->resource[KNOWN_DXGI_INDEX],
+ p_src_sys->slice_index,
+ NULL);
+ }
+ else
+ {
+ ID3D11DeviceContext_CopySubresourceRegion(p_outpic->p_sys->context,
+ p_outpic->p_sys->resource[KNOWN_DXGI_INDEX],
+ p_outpic->p_sys->slice_index,
+ 0, 0, 0,
+ p_sys->out[outputs[idx] == p_sys->procOutput[0] ? 1 : 0].resource,
+ 0,
+ NULL);
+ }
if( p_sys->context_mutex != INVALID_HANDLE_VALUE )
ReleaseMutex( p_sys->context_mutex );
More information about the vlc-commits
mailing list