BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height)
{
- if ((flags & FREERDP_CODEC_INTERLEAVED))
+ if ((flags & FREERDP_CODEC_INTERLEAVED) && !codecs->interleaved)
{
bitmap_interleaved_context_free(codecs->interleaved);
}
}
- if ((flags & FREERDP_CODEC_PLANAR))
+ if ((flags & FREERDP_CODEC_PLANAR) && !codecs->planar)
{
freerdp_bitmap_planar_context_free(codecs->planar);
}
}
- if ((flags & FREERDP_CODEC_NSCODEC))
+ if ((flags & FREERDP_CODEC_NSCODEC) && !codecs->nsc)
{
nsc_context_free(codecs->nsc);
}
}
- if ((flags & FREERDP_CODEC_REMOTEFX))
+ if ((flags & FREERDP_CODEC_REMOTEFX) && !codecs->rfx)
{
rfx_context_free(codecs->rfx);
}
}
- if ((flags & FREERDP_CODEC_CLEARCODEC))
+ if ((flags & FREERDP_CODEC_CLEARCODEC) && !codecs->clear)
{
clear_context_free(codecs->clear);
}
}
- if (flags & FREERDP_CODEC_ALPHACODEC)
+ if ((flags & FREERDP_CODEC_ALPHACODEC))
{
}
- if ((flags & FREERDP_CODEC_PROGRESSIVE))
+ if ((flags & FREERDP_CODEC_PROGRESSIVE) && !codecs->progressive)
{
progressive_context_free(codecs->progressive);
}
#ifdef WITH_GFX_H264
- if ((flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)))
+ if ((flags & (FREERDP_CODEC_AVC420 | FREERDP_CODEC_AVC444)) && !codecs->h264)
{
h264_context_free(codecs->h264);
return FALSE;
context = gdi->context;
- freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL,
- context->settings->DesktopWidth,
- context->settings->DesktopHeight);
gdi->gfx = gfx;
gfx->custom = (void*)gdi;