[vlc-commits] transform: inline error handling
Alexandre Janniaux
git at videolan.org
Wed Jan 13 16:35:45 UTC 2021
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Thu Jan 7 16:35:19 2021 +0100| [e2f5e841394f35250dc5f0988bab572dc681850e] | committer: Alexandre Janniaux
transform: inline error handling
...and remove useless error label. The resources are released by the
vlc_objres mechanism already.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2f5e841394f35250dc5f0988bab572dc681850e
---
modules/video_filter/transform.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/modules/video_filter/transform.c b/modules/video_filter/transform.c
index 473bd4f9fa..96397d0f7a 100644
--- a/modules/video_filter/transform.c
+++ b/modules/video_filter/transform.c
@@ -348,7 +348,7 @@ static int Open(filter_t *filter)
default:
msg_Err(filter, "Unsupported pixel size %u (chroma %4.4s)",
chroma->pixel_size, (char *)&src->i_chroma);
- goto error;
+ return VLC_EGENERIC;
}
for (unsigned i = 1; i < PICTURE_PLANE_MAX; i++)
@@ -367,7 +367,7 @@ static int Open(filter_t *filter)
!= chroma->p[i].h.num * chroma->p[i].w.den) {
msg_Err(filter, "Format rotation not possible "
"(chroma %4.4s)", (char *)&src->i_chroma);
- goto error;
+ return VLC_EGENERIC;
}
}
}
@@ -393,7 +393,7 @@ static int Open(filter_t *filter)
dst->i_y_offset != src_trans.i_y_offset)) {
msg_Err(filter, "Format change is not allowed");
- goto error;
+ return VLC_EGENERIC;
}
else if(filter->b_allow_fmt_out_change) {
@@ -414,7 +414,7 @@ static int Open(filter_t *filter)
if (dsc_is_rotated(dsc)) {
msg_Err(filter, "Format rotation not possible (chroma %4.4s)",
(char *)&src->i_chroma);
- goto error;
+ return VLC_EGENERIC;
}
/* fallthrough */
case VLC_CODEC_YUYV:
@@ -423,7 +423,7 @@ static int Open(filter_t *filter)
break;
case VLC_CODEC_NV12:
case VLC_CODEC_NV21:
- goto error;
+ return VLC_EGENERIC;
}
static const struct vlc_filter_operations filter_ops =
@@ -434,7 +434,4 @@ static int Open(filter_t *filter)
filter->ops = &filter_ops;
filter->p_sys = sys;
return VLC_SUCCESS;
-error:
- vlc_obj_free(VLC_OBJECT(filter), sys);
- return VLC_EGENERIC;
}
More information about the vlc-commits
mailing list