libavutil: hwcontext_amf: remove unreachable statements

Inside the amf_device_derive() function, there seem to be some
unreachable 'break' statements, which can be removed.
And also the final 'return 0' statement will also be unreachable
especially since there is a default case in the switch block.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
This commit is contained in:
Alexandru Ardelean
2026-03-02 13:15:59 +02:00
committed by ArazIusubov
parent cebe0b577e
commit 3291afd30f

View File

@@ -638,33 +638,23 @@ static int amf_device_derive(AVHWDeviceContext *device_ctx,
return ret;
switch (child_device_ctx->type) {
#if CONFIG_DXVA2
case AV_HWDEVICE_TYPE_DXVA2: {
return amf_init_from_dxva2_device(amf_ctx, child_device_ctx);
}
break;
case AV_HWDEVICE_TYPE_DXVA2:
return amf_init_from_dxva2_device(amf_ctx, child_device_ctx);
#endif
#if CONFIG_D3D11VA
case AV_HWDEVICE_TYPE_D3D11VA: {
return amf_init_from_d3d11_device(amf_ctx, child_device_ctx);
}
break;
case AV_HWDEVICE_TYPE_D3D11VA:
return amf_init_from_d3d11_device(amf_ctx, child_device_ctx);
#endif
#if CONFIG_D3D12VA
case AV_HWDEVICE_TYPE_D3D12VA: {
return amf_init_from_d3d12_device(amf_ctx, child_device_ctx);
}
break;
case AV_HWDEVICE_TYPE_D3D12VA:
return amf_init_from_d3d12_device(amf_ctx, child_device_ctx);
#endif
default: {
av_log(child_device_ctx, AV_LOG_ERROR, "AMF initialisation from a %s device is not supported.\n",
av_hwdevice_get_type_name(child_device_ctx->type));
return AVERROR(ENOSYS);
}
default:
av_log(child_device_ctx, AV_LOG_ERROR, "AMF initialisation from a %s device is not supported.\n",
av_hwdevice_get_type_name(child_device_ctx->type));
return AVERROR(ENOSYS);
}
return 0;
}
const HWContextType ff_hwcontext_type_amf = {