[vlc-devel] [PATCH 2/2] module: don't probe next modules if killed
Rémi Denis-Courmont
remi at remlab.net
Thu Oct 24 11:38:55 CEST 2019
This evidently breaks module probing after kill, which is of course wrong the same way that breaking polling is wrong.
Le 24 octobre 2019 10:17:27 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>This fixes the following case (it's just an example, it may fix some
>others).
>
>- a samba module is first probed, it asks for user credentials and show
>a
>dialog. The user cancel the media parsing instead of canceling the
>dialog
> (hit Ctrl-C on Desktop when a dialog is shown)
>
>- A next samba module is probed and will also ask for credential. A
>dialog
> will be shown even though the user asked to terminate VLC.
>
>To fix this issue, this commit prevent the next module to load if the
>current
>thread loading the module is killed.
>
>There is no possible race here, even if the thread is killed just after
>the
>second module is loaded. In that case next dialog, poll and read call
>will be
>interrupted and no dialog will be shown.
>---
> src/modules/modules.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/src/modules/modules.c b/src/modules/modules.c
>index 2df5702f840..c3a4228aa22 100644
>--- a/src/modules/modules.c
>+++ b/src/modules/modules.c
>@@ -37,6 +37,7 @@
>
> #include <vlc_common.h>
> #include <vlc_modules.h>
>+#include <vlc_interrupt.h>
> #include "libvlc.h"
> #include "config/configuration.h"
> #include "vlc_arrays.h"
>@@ -199,6 +200,9 @@ module_t *(vlc_module_load)(struct vlc_logger *log,
>const char *capability,
> /* fall through */
> case VLC_ETIMEOUT:
> goto done;
>+ default:
>+ if (vlc_killed())
>+ goto done;
> }
> }
> }
>@@ -220,6 +224,9 @@ module_t *(vlc_module_load)(struct vlc_logger *log,
>const char *capability,
> /* fall through */
> case VLC_ETIMEOUT:
> goto done;
>+ default:
>+ if (vlc_killed())
>+ goto done;
> }
> }
> }
>--
>2.20.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20191024/d2efb2a1/attachment.html>
More information about the vlc-devel
mailing list