<html><head></head><body><div class="gmail_quote">Le 4 août 2017 15:54:56 GMT+03:00, Steve Lhomme <robux4@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Otherwise we keep trying them all.<br />---<br /> modules/codec/avcodec/video.c | 36 ++++++++++++++++++++++++++++++++++++<br /> 1 file changed, 36 insertions(+)<br /><br />diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c<br />index 14668db0c4..6368896e3e 100644<br />--- a/modules/codec/avcodec/video.c<br />+++ b/modules/codec/avcodec/video.c<br />@@ -1490,12 +1490,48 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,<br /> can_hwaccel = true;<br /> }<br /> <br />+ enum PixelFormat fmts[3];<br /> char * var = var_InheritString(p_dec, "avcodec-hw");<br /> if (var == NULL || !strcmp( var, "none" ))<br /> {<br /> msg_Dbg( p_dec, "disable hardware decoders" );<br /> can_hwaccel = false;<br /> }<br />+ else<br />+ {<br />+ enum PixelFormat hwfmt = AV_PIX_FMT_NONE;<br />+ if (!strcmp( var, "d3d11va" ))<br />+ hwfmt = AV_PIX_FMT_D3D11VA_VLD;<br />+ else if (!strcmp( var, "dxva2" ))<br />+ hwfmt = AV_PIX_FMT_DXVA2_VLD;<br />+ else if (!strcmp( var, "vdpau" ))<br />+ hwfmt = AV_PIX_FMT_VDPAU;<br />+ else if (!strcmp( var, "vaapi" ))<br />+ hwfmt = AV_PIX_FMT_VAAPI_VLD;<br />+ else if (strcmp( var, "any" ))<br />+ {<br />+ msg_Dbg( p_dec, "Unknown hardware decoder %s", var );<br />+ }<br />+<br />+ if (hwfmt != AV_PIX_FMT_NONE)<br />+ {<br />+ size_t j;<br />+ for( j = 0; pi_fmt[j] != AV_PIX_FMT_NONE; j++ )<br />+ {<br />+ if (pi_fmt[j] == hwfmt)<br />+ {<br />+ fmts[0] = hwfmt;<br />+ fmts[1] = swfmt;<br />+ fmts[2] = AV_PIX_FMT_NONE;<br />+ break;<br />+ }<br />+ }<br />+ if (pi_fmt[j] == AV_PIX_FMT_NONE)<br />+ can_hwaccel = false; /* no hardware flavor possible anyway */<br />+ else<br />+ pi_fmt = (const enum PixelFormat *)&fmts;<br />+ }<br />+ }<br /> free(var);<br /> <br /> /* If the format did not actually change (e.g. seeking), try to reuse the</pre></blockquote></div><br clear="all">That's intended. Working/not-working is not quite a static setting.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>