vlc | branch: master | Steve Lhomme <rob...@videolabs.io> | Wed Nov 22 18:18:24 2017 +0100| [b2c55fee53e227d577db3ad4e7a0ac0209874978] | committer: Jean-Baptiste Kempf
hw:d3d11: clean code Use local variables when possible Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b2c55fee53e227d577db3ad4e7a0ac0209874978 --- modules/hw/d3d11/d3d11_adjust.c | 16 ++++++++-------- modules/hw/d3d11/d3d11_deinterlace.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/hw/d3d11/d3d11_adjust.c b/modules/hw/d3d11/d3d11_adjust.c index e00bdf3c7a..c954c79c08 100644 --- a/modules/hw/d3d11/d3d11_adjust.c +++ b/modules/hw/d3d11/d3d11_adjust.c @@ -350,7 +350,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; - const video_format_t *fmt = &dst->format; + const video_format_t *fmt = &filter->fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE, @@ -360,11 +360,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, - .OutputWidth = dst->format.i_width, - .OutputHeight = dst->format.i_height, + .OutputWidth = dstDesc.Width, + .OutputHeight = dstDesc.Height, .OutputFrameRate = { - .Numerator = dst->format.i_frame_rate, - .Denominator = dst->format.i_frame_rate_base, + .Numerator = fmt->i_frame_rate, + .Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -379,16 +379,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif - hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, &flags); + hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, &flags); if (!SUCCEEDED(hr)) { - msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); + msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { - msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); + msg_Dbg(filter, "input/output %s is not supported", DxgiFormatToStr(dstDesc.Format)); goto error; } diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index b47f0dc342..1e310fb2dc 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -332,7 +332,7 @@ static int Open(vlc_object_t *obj) msg_Warn(filter, "No mutex found to lock the decoder"); sys->context_mutex = context_lock; - const video_format_t *fmt = &dst->format; + const video_format_t *fmt = &filter->fmt_out.video; D3D11_VIDEO_PROCESSOR_CONTENT_DESC processorDesc = { .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST, @@ -342,11 +342,11 @@ static int Open(vlc_object_t *obj) }, .InputWidth = fmt->i_width, .InputHeight = fmt->i_height, - .OutputWidth = dst->format.i_width, - .OutputHeight = dst->format.i_height, + .OutputWidth = dstDesc.Width, + .OutputHeight = dstDesc.Height, .OutputFrameRate = { - .Numerator = dst->format.i_frame_rate, - .Denominator = dst->format.i_frame_rate_base, + .Numerator = fmt->i_frame_rate, + .Denominator = fmt->i_frame_rate_base, }, .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL, }; @@ -361,16 +361,16 @@ static int Open(vlc_object_t *obj) #ifndef NDEBUG D3D11_LogProcessorSupport(filter, processorEnumerator); #endif - hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dst->p_sys->formatTexture, &flags); + hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, dstDesc.Format, &flags); if (!SUCCEEDED(hr)) { - msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dst->p_sys->formatTexture)); + msg_Dbg(filter, "can't read processor support for %s", DxgiFormatToStr(dstDesc.Format)); goto error; } if ( !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT) || !(flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT) ) { - msg_Dbg(filter, "deinterlacing %s is not supported", DxgiFormatToStr(dst->p_sys->formatTexture)); + msg_Dbg(filter, "deinterlacing %s is not supported", DxgiFormatToStr(dstDesc.Format)); goto error; } _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits