Commit 8049ee94 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: use a fallback chroma when default doesn't work and vout is forced

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d1e7dc1f
......@@ -1479,8 +1479,25 @@ static int Direct3D11Open(vout_display_t *vd)
video_format_t fmt;
video_format_Copy(&fmt, &vd->source);
int err = SetupOutputFormat(vd, &fmt);
if (err != VLC_SUCCESS)
{
if (!is_d3d11_opaque(vd->source.i_chroma) && vd->obj.force )
{
const vlc_fourcc_t *list = vlc_fourcc_IsYUV(vd->source.i_chroma) ?
vlc_fourcc_GetYUVFallback(vd->source.i_chroma) :
vlc_fourcc_GetRGBFallback(vd->source.i_chroma);
for (unsigned i = 0; list[i] != 0; i++) {
fmt.i_chroma = list[i];
if (fmt.i_chroma == vd->source.i_chroma)
continue;
err = SetupOutputFormat(vd, &fmt);
if (err == VLC_SUCCESS)
break;
}
}
if (err != VLC_SUCCESS)
return err;
}
if (Direct3D11CreateGenericResources(vd)) {
msg_Err(vd, "Failed to allocate resources");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment