This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 3291afd30f libavutil: hwcontext_amf: remove unreachable statements
3291afd30f is described below
commit 3291afd30f9dae0c454cc9df4688f0c645a82109
Author: Alexandru Ardelean <[email protected]>
AuthorDate: Mon Mar 2 13:15:59 2026 +0200
Commit: ArazIusubov <[email protected]>
CommitDate: Thu Mar 5 15:42:00 2026 +0000
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 <[email protected]>
---
libavutil/hwcontext_amf.c | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/libavutil/hwcontext_amf.c b/libavutil/hwcontext_amf.c
index 57bf08bc65..d6a97c0a51 100644
--- a/libavutil/hwcontext_amf.c
+++ b/libavutil/hwcontext_amf.c
@@ -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 = {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]