[vlc-commits] Fix build with VLC 4.0

Hugo Beauzée-Luyssen git at videolan.org
Wed May 29 14:47:39 CEST 2019


npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed May 29 12:09:18 2019 +0200| [4eafcb16f4513d5cf10d0c5bc4c388a0bfa7d91c] | committer: Hugo Beauzée-Luyssen

Fix build with VLC 4.0

> https://code.videolan.org/videolan/npapi-vlc/commit/4eafcb16f4513d5cf10d0c5bc4c388a0bfa7d91c
---

 activex/plugin.cpp            | 6 ++++++
 activex/vlccontrol2.cpp       | 4 ++++
 npapi/npruntime/npolibvlc.cpp | 4 ++++
 npapi/vlcplugin_base.cpp      | 4 ++++
 npapi/vlcplugin_gtk.cpp       | 4 ++++
 5 files changed, 22 insertions(+)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 2d103f3..5981b66 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -793,7 +793,13 @@ BOOL VLCPlugin::getFullscreen()
 HRESULT VLCPlugin::onInPlaceDeactivate(void)
 {
     if( m_player.mlp().isPlaying() )
+    {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+        m_player.mlp().stopAsync();
+#else
         m_player.mlp().stop();
+#endif
+    }
 
     _WindowsManager.DestroyWindows();
 
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 0eb6043..43784d2 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1079,7 +1079,11 @@ STDMETHODIMP VLCPlaylist::togglePause()
 
 STDMETHODIMP VLCPlaylist::stop()
 {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    _plug->get_player().mlp().stopAsync();
+#else
     _plug->get_player().mlp().stop();
+#endif
     return S_OK;
 }
 
diff --git a/npapi/npruntime/npolibvlc.cpp b/npapi/npruntime/npolibvlc.cpp
index 814bf8c..af36a27 100644
--- a/npapi/npruntime/npolibvlc.cpp
+++ b/npapi/npruntime/npolibvlc.cpp
@@ -1011,7 +1011,11 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
             case ID_playlist_stop:
                 if( argCount == 0 )
                 {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+                    p_plugin->player().mlp().stopAsync();
+#else
                     p_plugin->player().mlp().stop();
+#endif
                     return INVOKERESULT_NO_ERROR;
                 }
                 return INVOKERESULT_NO_SUCH_METHOD;
diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 9a3c035..79232ef 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -665,7 +665,11 @@ void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked)
 
         case clicked_Stop:
         {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+            player().get_mp().stopAsync();
+#else
             player().get_mp().stop();
+#endif
         }
         break;
 
diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index b909ebf..1765aee 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -326,7 +326,11 @@ gboolean VlcPluginGtk::update_time_slider(gpointer user_data)
 static bool time_slider_handler(GtkRange*, GtkScrollType, gdouble value, gpointer user_data)
 {
     VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    plugin->getMD().setPosition( value / 100.0, true );
+#else
     plugin->getMD().setPosition( value / 100.0 );
+#endif
     return false;
 }
 



More information about the vlc-commits mailing list