[vlc-commits] QtPlayer example: fix compilation with newer Qt/libvlc

Steve Lhomme git at videolan.org
Thu May 7 08:30:11 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May  7 08:28:34 2020 +0200| [0ade21ad07f88f77fbf296af0fc71bec179ee7ab] | committer: Steve Lhomme

QtPlayer example: fix compilation with newer Qt/libvlc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ade21ad07f88f77fbf296af0fc71bec179ee7ab
---

 doc/libvlc/QtPlayer/player.cpp | 10 ++++++++--
 doc/libvlc/QtPlayer/player.h   |  4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/libvlc/QtPlayer/player.cpp b/doc/libvlc/QtPlayer/player.cpp
index b1316026ba..3e68f064ae 100644
--- a/doc/libvlc/QtPlayer/player.cpp
+++ b/doc/libvlc/QtPlayer/player.cpp
@@ -11,6 +11,12 @@
 #define qtu( i ) ((i).toUtf8().constData())
 
 #include <QtGui>
+#include <QMessageBox>
+#include <QMenuBar>
+#include <QAction>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QFileDialog>
 
 Mwindow::Mwindow() {
     vlcPlayer = NULL;
@@ -142,7 +148,7 @@ void Mwindow::openFile() {
 #elif defined(Q_OS_UNIX)
     libvlc_media_player_set_xwindow(vlcPlayer, videoWidget->winId());
 #elif defined(Q_OS_WIN)
-    libvlc_media_player_set_hwnd(vlcPlayer, videoWidget->winId());
+    libvlc_media_player_set_hwnd(vlcPlayer, (HWND)videoWidget->winId());
 #endif
 
     /* And start playback */
@@ -181,7 +187,7 @@ int Mwindow::changeVolume(int vol) { /* Called on volume slider change */
 void Mwindow::changePosition(int pos) { /* Called on position slider change */
 
     if (vlcPlayer)
-        libvlc_media_player_set_position(vlcPlayer, (float)pos/1000.0);
+        libvlc_media_player_set_position(vlcPlayer, (float)pos/1000.0, true);
 }
 
 void Mwindow::updateInterface() { //Update interface and check if song is finished
diff --git a/doc/libvlc/QtPlayer/player.h b/doc/libvlc/QtPlayer/player.h
index 495ea95311..8a5d192a6f 100644
--- a/doc/libvlc/QtPlayer/player.h
+++ b/doc/libvlc/QtPlayer/player.h
@@ -9,6 +9,10 @@
 #define PLAYER
 
 #include <QtGui>
+#include <QMainWindow>
+#include <QPushButton>
+#include <QSlider>
+#include <QWidget>
 #include <vlc/vlc.h>
 
 class Mwindow : public QMainWindow {



More information about the vlc-commits mailing list