[vlc-commits] NPAPI: asynchronous 'stop' when requested through controls, so it does not block the browser if it takes a long time.

Cheng Sun git at videolan.org
Sat Jan 21 22:16:33 CET 2012


npapi-vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Sat Jan 21 10:40:20 2012 +0000| [6bd74731a59fac57d8e538c6f10236d8f6453097] | committer: Cheng Sun

NPAPI: asynchronous 'stop' when requested through controls, so it does not block the browser if it takes a long time.

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

 npapi/vlcplugin_base.cpp |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 847490c..e31a34e 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -865,6 +865,13 @@ relativeurl:
     return NULL;
 }
 
+static void *playlist_stop_thread(void *arg)
+{
+    VlcPluginBase *p_plugin = (VlcPluginBase *) arg;
+    p_plugin->playlist_stop();
+    return NULL;
+}
+
 void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked)
 {
     switch( clicked )
@@ -883,7 +890,9 @@ void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked)
 
         case clicked_Stop:
         {
-            playlist_stop();
+            pthread_t thread;
+            pthread_create(&thread, NULL, &playlist_stop_thread, this);
+            pthread_detach(thread);
         }
         break;
 



More information about the vlc-commits mailing list