[vlc-commits] Fix build with VLC 4.0

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


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

Fix build with VLC 4.0

> https://code.videolan.org/videolan/npapi-vlc/commit/60ebc3905aa8b285032c0e6e5ec844d3e641a08a
---

 activex/plugin.cpp            | 6 ++++++
 activex/vlccontrol2.cpp       | 4 ++++
 npapi/npruntime/npolibvlc.cpp | 4 ++++
 npapi/vlcplugin_base.cpp      | 4 ++++
 npapi/vlcplugin_gtk.cpp       | 4 ++++
 vlcpp                         | 2 +-
 6 files changed, 23 insertions(+), 1 deletion(-)

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;
 }
 
diff --git a/vlcpp b/vlcpp
index 5147d35..57b762e 160000
--- a/vlcpp
+++ b/vlcpp
@@ -1 +1 @@
-Subproject commit 5147d358c5918bdf1ebb96d1292b3b7ac2c800f9
+Subproject commit 57b762ebc401e2f4ec737fddf0a517b597680b09



More information about the vlc-commits mailing list