[vlc-commits] [Git][videolan/npapi-vlc][master] Fix build with VLC 4.0

Hugo Beauzée-Luyssen gitlab at videolan.org
Mon Jul 2 13:47:24 CEST 2018


Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC Browser Plugins


Commits:
52a8fbe3 by Hugo Beauzée-Luyssen at 2018-07-02T13:46:56+02:00
Fix build with VLC 4.0

- - - - -


4 changed files:

- activex/plugin.cpp
- activex/vlccontrol2.cpp
- common/win32_fullscreen.cpp
- npapi/npruntime/npolibvlc.cpp


Changes:

=====================================
activex/plugin.cpp
=====================================
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -764,7 +764,11 @@ void VLCPlugin::setTime(int seconds)
     if( seconds != _i_time )
     {
         setStartTime(_i_time);
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+        m_player.get_mp().setTime( _i_time, true );
+#else
         m_player.get_mp().setTime( _i_time );
+#endif
     }
 }
 


=====================================
activex/vlccontrol2.cpp
=====================================
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -734,7 +734,11 @@ STDMETHODIMP VLCInput::get_position(double* position)
 
 STDMETHODIMP VLCInput::put_position(double position)
 {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    _plug->get_player().get_mp().setPosition( static_cast<float>(position), true );
+#else
     _plug->get_player().get_mp().setPosition( static_cast<float>(position) );
+#endif
 
     return S_OK;
 }
@@ -751,7 +755,11 @@ STDMETHODIMP VLCInput::get_time(double* time)
 
 STDMETHODIMP VLCInput::put_time(double time)
 {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    _plug->get_player().get_mp().setTime(static_cast<libvlc_time_t>(time), true);
+#else
     _plug->get_player().get_mp().setTime(static_cast<libvlc_time_t>(time));
+#endif
 
     return S_OK;
 }


=====================================
common/win32_fullscreen.cpp
=====================================
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -460,7 +460,11 @@ void VLCControlsWnd::NeedHideControls()
 void VLCControlsWnd::SetVideoPos(float Pos) //0-start, 1-end
 {
     if( VP() ){
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+        VP()->get_mp().setPosition( Pos, true );
+#else
         VP()->get_mp().setPosition( Pos );
+#endif
 
         if( VP()->get_mp().length() > 0 )
             PostMessage(hVideoPosScroll, (UINT)PBM_SETPOS, (WPARAM) (Pos * 1000), 0);


=====================================
npapi/npruntime/npolibvlc.cpp
=====================================
--- a/npapi/npruntime/npolibvlc.cpp
+++ b/npapi/npruntime/npolibvlc.cpp
@@ -536,7 +536,11 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value)
                     return INVOKERESULT_INVALID_VALUE;
                 }
 
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+                mp.setPosition( v, true );
+#else
                 mp.setPosition( v );
+#endif
                 return INVOKERESULT_NO_ERROR;
             }
             case ID_input_time:
@@ -546,7 +550,11 @@ LibvlcInputNPObject::setProperty(int index, const NPVariant &value)
                     return INVOKERESULT_INVALID_VALUE;
                 }
 
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+                mp.setTime( v, true );
+#else
                 mp.setTime( v );
+#endif
                 return INVOKERESULT_NO_ERROR;
             }
             case ID_input_rate:



View it on GitLab: https://code.videolan.org/videolan/npapi-vlc/commit/52a8fbe36751606931682a72e949a2e0c3950078

-- 
View it on GitLab: https://code.videolan.org/videolan/npapi-vlc/commit/52a8fbe36751606931682a72e949a2e0c3950078
You're receiving this email because of your account on code.videolan.org.


More information about the vlc-commits mailing list