[vlc-devel] commit: lua/extension: Make sure our input exists when releasing/holding. ( Pierre d'Herbemont )

git version control git at videolan.org
Fri Jan 29 11:49:35 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Fri Jan 29 11:46:54 2010 +0100| [bcfa8de45dfd41d733965840991d446f64f0d6e2] | committer: Pierre d'Herbemont 

lua/extension: Make sure our input exists when releasing/holding.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bcfa8de45dfd41d733965840991d446f64f0d6e2
---

 modules/misc/lua/extension.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c
index 8ef54b9..3e5d571 100644
--- a/modules/misc/lua/extension.c
+++ b/modules/misc/lua/extension.c
@@ -472,8 +472,10 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
             bool ok = LockExtension(p_ext);
             if (!ok)
                 return VLC_EGENERIC;
-            vlc_object_release(p_ext->p_sys->p_input);
-            p_ext->p_sys->p_input = vlc_object_hold(p_input);
+            input_thread_t *old = p_ext->p_sys->p_input;
+            if (old)
+                vlc_object_release(old);
+            p_ext->p_sys->p_input = p_input ? vlc_object_hold(p_input) : p_input;
             UnlockExtension(p_ext);
 
             return VLC_SUCCESS;




More information about the vlc-devel mailing list