[vlc-devel] [Patch] Extensions and Lua dialogs
Rémi Denis-Courmont
remi at remlab.net
Sat Jan 23 16:32:57 CET 2010
Le jeudi 21 janvier 2010 23:53:14 Jean-Philippe André, vous avez écrit :
> Hello,
>
> I want to let you know that I have updated my patches for the Extensions
> and Lua dialogs. As I don't necessarily want to spam the mailing list once
> again, those of you who are interested can find them at the following URL:
>
> http://jpeg.dinauz.org/VideoLAN/patches/extensions/
>
> The scripts provided there are only examples, I don't want to push those in
> the official Git right now.
+ /* After dialog_ExtensionUpdate, the UI thread must take the lock asap
and
+ * then signal us when it's done deleting the dialog.
+ * Note: Wait up to 2s.
+ */
+ mtime_t abstime = mdate() + 2000000;
What if the UI is struggling with a slow remote X11 display? What if you are
running in gdb and you've been STOPped for a while?
+ vlc_mutex_lock( &p_dlg->lock );
+ if( p_dlg->p_sys_intf != NULL )
Should probably be 'while'.
+ vlc_cond_timedwait( &p_dlg->cond, &p_dlg->lock, abstime );
+ vlc_mutex_unlock( &p_dlg->lock );
+ if( p_dlg->p_sys_intf != NULL )
+ {
+ /* 2s after ExtUpdate, the dialog is still open. In order to avoid
+ * unnecessary crashes, we leak the dialog.
+ * This case should not happen (and does not in normal conditions).
+ */
+ msg_Warn( p_mgr, "Could not delete the dialog properly in 2s. "
+ "Leaking its descriptor." );
+ p_dlg->p_sys_intf = NULL;
+ return 1;
+ }
Pleeease. No. That won't save you from crashing anyway, because the UI plugin
may be unloaded.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list