Skip to content

Commit

Permalink
direct3d11: use a fallback chroma when default doesn't work and vout …
Browse files Browse the repository at this point in the history
…is forced

Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
robUx4 authored and jbkempf committed Nov 28, 2017
1 parent d1e7dc1 commit 8049ee9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/video_output/win32/direct3d11.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,24 @@ static int Direct3D11Open(vout_display_t *vd)
video_format_Copy(&fmt, &vd->source);
int err = SetupOutputFormat(vd, &fmt);
if (err != VLC_SUCCESS)
return err;
{
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");
Expand Down

0 comments on commit 8049ee9

Please sign in to comment.