hwcontext_dxva2: do not assume the destination format during mapping is always the right one
Handle the cases where it is unsupported or unset.
This commit is contained in:
@@ -345,6 +345,10 @@ static int dxva2_map_from(AVHWFramesContext *ctx,
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (dst->format != AV_PIX_FMT_NONE && dst->format != ctx->sw_format)
|
||||||
|
return AVERROR(ENOSYS);
|
||||||
|
dst->format = ctx->sw_format;
|
||||||
|
|
||||||
err = dxva2_map_frame(ctx, dst, src, flags);
|
err = dxva2_map_frame(ctx, dst, src, flags);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user