[vlc-commits] ActiveX: Sync argument of fireOnMediaPlayerBufferingEvent/ fireOnMediaPlayerTimeChangedEvent/ fireOnMediaPlayerPositionChangedEvent with libvlc_event_t

Sergey Radionov git at videolan.org
Wed Dec 21 12:54:17 CET 2011


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Thu Nov 17 09:21:09 2011 +0700| [30357f82af569d233fdcf8c554741c998ec66bdc] | committer: Jean-Baptiste Kempf

ActiveX: Sync argument of fireOnMediaPlayerBufferingEvent/fireOnMediaPlayerTimeChangedEvent/fireOnMediaPlayerPositionChangedEvent with libvlc_event_t

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 activex/plugin.cpp |   12 ++++++------
 activex/plugin.h   |    6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index a439600..e4450d5 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -1037,14 +1037,14 @@ void VLCPlugin::fireOnMediaPlayerOpeningEvent()
     vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerOpeningEvent, &dispparamsNoArgs);
 };
 
-void VLCPlugin::fireOnMediaPlayerBufferingEvent(long cache)
+void VLCPlugin::fireOnMediaPlayerBufferingEvent(float cache)
 {
     DISPPARAMS params;
     params.cArgs = 1;
     params.rgvarg = (VARIANTARG *) CoTaskMemAlloc(sizeof(VARIANTARG) * params.cArgs) ;
     memset(params.rgvarg, 0, sizeof(VARIANTARG) * params.cArgs);
     params.rgvarg[0].vt = VT_I4;
-    params.rgvarg[0].lVal = cache;
+    params.rgvarg[0].lVal = static_cast<LONG>(cache);
     params.rgdispidNamedArgs = NULL;
     params.cNamedArgs = 0;
     vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerBufferingEvent, &params);
@@ -1130,14 +1130,14 @@ static void handle_input_state_event(const libvlc_event_t* event, void *param)
     }
 }
 
-void VLCPlugin::fireOnMediaPlayerTimeChangedEvent(long time)
+void VLCPlugin::fireOnMediaPlayerTimeChangedEvent(libvlc_time_t  time)
 {
     DISPPARAMS params;
     params.cArgs = 1;
     params.rgvarg = (VARIANTARG *) CoTaskMemAlloc(sizeof(VARIANTARG) * params.cArgs) ;
     memset(params.rgvarg, 0, sizeof(VARIANTARG) * params.cArgs);
     params.rgvarg[0].vt = VT_I4;
-    params.rgvarg[0].lVal = time;
+    params.rgvarg[0].lVal = static_cast<LONG>(time);
     params.rgdispidNamedArgs = NULL;
     params.cNamedArgs = 0;
     vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerTimeChangedEvent, &params);
@@ -1149,14 +1149,14 @@ static void handle_time_changed_event(const libvlc_event_t* event, void *param)
     plugin->fireOnMediaPlayerTimeChangedEvent(event->u.media_player_time_changed.new_time);
 }
 
-void VLCPlugin::fireOnMediaPlayerPositionChangedEvent(long position)
+void VLCPlugin::fireOnMediaPlayerPositionChangedEvent(float position)
 {
     DISPPARAMS params;
     params.cArgs = 1;
     params.rgvarg = (VARIANTARG *) CoTaskMemAlloc(sizeof(VARIANTARG) * params.cArgs) ;
     memset(params.rgvarg, 0, sizeof(VARIANTARG) * params.cArgs);
     params.rgvarg[0].vt = VT_I4;
-    params.rgvarg[0].lVal = position;
+    params.rgvarg[0].lVal = static_cast<LONG>(position);
     params.rgdispidNamedArgs = NULL;
     params.cNamedArgs = 0;
     vlcConnectionPointContainer->fireEvent(DISPID_MediaPlayerPositionChangedEvent, &params);
diff --git a/activex/plugin.h b/activex/plugin.h
index 08e228e..5bd1ef4 100644
--- a/activex/plugin.h
+++ b/activex/plugin.h
@@ -247,7 +247,7 @@ public:
     // async events;
     void fireOnMediaPlayerNothingSpecialEvent();
     void fireOnMediaPlayerOpeningEvent();
-    void fireOnMediaPlayerBufferingEvent(long cache);
+    void fireOnMediaPlayerBufferingEvent(float cache);
     void fireOnMediaPlayerPlayingEvent();
     void fireOnMediaPlayerPausedEvent();
     void fireOnMediaPlayerForwardEvent();
@@ -256,8 +256,8 @@ public:
     void fireOnMediaPlayerEndReachedEvent();
     void fireOnMediaPlayerStoppedEvent();
 
-    void fireOnMediaPlayerTimeChangedEvent(long time);
-    void fireOnMediaPlayerPositionChangedEvent(long position);
+    void fireOnMediaPlayerTimeChangedEvent(libvlc_time_t time);
+    void fireOnMediaPlayerPositionChangedEvent(float position);
     void fireOnMediaPlayerSeekableChangedEvent(VARIANT_BOOL seekable);
     void fireOnMediaPlayerPausableChangedEvent(VARIANT_BOOL pausable);
 



More information about the vlc-commits mailing list