[vlc-devel] [PATCH] video_output: separate the error logs and return in vout_Request
Thomas Guillem
thomas at gllm.fr
Fri Oct 11 11:48:54 CEST 2019
On Fri, Oct 11, 2019, at 11:47, Steve Lhomme wrote:
> No need to stop the vout (thread, display) when failing to enable the window.
> If there wasn't an enabled window, there wasn't any of them.
>
> vout_Stop already clean sys->original, so no need to do it again.
> ---
> src/video_output/video_output.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/video_output/video_output.c
> b/src/video_output/video_output.c
> index 45374ec71aa..e187d0b3a47 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1977,7 +1977,9 @@ int vout_Request(const vout_configuration_t *cfg,
> input_thread_t *input)
>
> if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
> vlc_mutex_unlock(&sys->window_lock);
> - goto error;
> + msg_Err(vout, "failed to enable window");
> + video_format_Clean(&sys->original);
> + return -1;
> }
> sys->window_enabled = true;
> } else
> @@ -1992,14 +1994,14 @@ int vout_Request(const vout_configuration_t
> *cfg, input_thread_t *input)
>
> if (vout_Start(vout, cfg))
> {
> + msg_Err(vout, "video output display creation failed");
> + video_format_Clean(&sys->original);
> vout_DisableWindow(vout);
> - goto error;
> + return -1;
> }
> if (vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
> + msg_Err(vout, "video output thread creation failed");
Hi,
This log is not needed, cf. my last review.
> vout_Stop(vout);
> -error:
> - msg_Err(vout, "video output creation failed");
> - video_format_Clean(&sys->original);
> return -1;
> }
>
> --
> 2.17.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list