Hello community,
here is the log from the commit of package QMPlay2 for openSUSE:Factory checked in at 2016-09-23 11:41:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/QMPlay2 (Old)
and /work/SRC/openSUSE:Factory/.QMPlay2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "QMPlay2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/QMPlay2/QMPlay2.changes 2016-09-05 21:24:59.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.QMPlay2.new/QMPlay2.changes 2016-09-23 11:41:06.000000000 +0200
@@ -1,0 +2,8 @@
+Thu Sep 22 17:40:03 UTC 2016 - dap.darkness@gmail.com
+
+- Update to 16.09.21:
+ * Updated icon for YouTube quality button,
+ * Fixed screen saver blocking behavior,
+ * OpenGL2 bugfix.
+
+-------------------------------------------------------------------
Old:
----
QMPlay2-src-16.09.04.tar.xz
New:
----
QMPlay2-src-16.09.21.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ QMPlay2.spec ++++++
--- /var/tmp/diff_new_pack.z6qh2S/_old 2016-09-23 11:41:07.000000000 +0200
+++ /var/tmp/diff_new_pack.z6qh2S/_new 2016-09-23 11:41:07.000000000 +0200
@@ -17,7 +17,7 @@
Name: QMPlay2
-Version: 16.09.04
+Version: 16.09.21
Release: 0
Summary: A Qt based media player, streamer and downloader
License: LGPL-3.0+
++++++ QMPlay2-src-16.09.04.tar.xz -> QMPlay2-src-16.09.21.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/ChangeLog new/QMPlay2-src-16.09.21/ChangeLog
--- old/QMPlay2-src-16.09.04/ChangeLog 2016-09-04 16:05:05.000000000 +0200
+++ new/QMPlay2-src-16.09.21/ChangeLog 2016-09-21 19:54:48.000000000 +0200
@@ -1,3 +1,8 @@
+Changes in QMPlay2 build 16.09.21:
+ - updated icon for YouTube quality button,
+ - fix screen saver blocking behavior,
+ - OpenGL2 bugfix,
+
Changes in QMPlay2 build 16.09.04:
- don't load subtitles which needs decoder without the decoder,
- add checkbox to disable PBO in OpenGL2 module settings,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/README.md new/QMPlay2-src-16.09.21/README.md
--- old/QMPlay2-src-16.09.04/README.md 2016-09-04 11:51:56.000000000 +0200
+++ new/QMPlay2-src-16.09.21/README.md 2016-09-21 20:36:07.000000000 +0200
@@ -27,10 +27,14 @@
- [Download the newest Windows installer](https://github.com/zaps166/QMPlay2/releases).
-####Easy installation on Ubuntu
+####Easy installation on Ubuntu / Mint
- [Download the newest Ubuntu DEB package](https://github.com/zaps166/QMPlay2/releases).
+####Easy installation on Debian / Ubuntu / Mint (from unofficial repository)
+
+- [Follow installation instructions on OBS](https://software.opensuse.org/download.html?project=home%3Astevepassert&package=qmplay2).
+
####Easy installation on Arch Linux / Manjaro Linux
- Arch Linux only: Install AUR client (e.g. yaourt),
@@ -66,27 +70,13 @@
Some YouTube videos don't work without external "youtube-dl" software, so QMPlay2 will ask you for downloading it if "youtube-dl" doesn't exist.
-You can also install it manually:
-
####Windows
-- [Watch the video](https://raw.githubusercontent.com/zaps166/GitHubCommonContents/master/Videos...).
-- If the video doesn't play inside the web browser - copy the address, paste it to QMPlay2 (Ctrl+V) and play it!
-- Currently (as of 30.06.2016) "youtube-dl.exe" needs Visual Studio 2010 Redistributable Package.
-- Make sure that antivirus or firewall doesn't block it (and doesn't block executing external application)!
-
-####Arch Linux / Manjaro Linux
+- Make sure that antivirus or firewall doesn't block "youtube-dl" and doesn't block executing external applications!
-- Install "youtube-dl" from repositories: `sudo pacman -S youtube-dl`.
+####Linux
-Even if Arch Linux repositories provides fresh packages, it is better to don't use "youtube-dl" from them.
-
-####Other Linux distributions or other operating system
-
-- Don't use "youtube-dl" from repositories - usually it contains too old package which no longer works. The exception is Arch Linux.
-- Download "youtube-dl": http://rg3.github.io/youtube-dl/download.html
-- Set the path for the script (you must have Python installed) in QMPlay2 YouTube settings (you can watch the video from Windows installation).
-- QMPlay2 can automatically updates the "youtube-dl" if it is not installed from repositories.
+- Don't use "youtube-dl" from repositories - usually it contains too old package which no longer works.
##Spherical view
@@ -202,8 +192,6 @@
- for Qt5 build (recommend for Qt5 >= 5.6.1): `sudo pacman -S qt5-base qt5-tools`,
- for Qt4 build: `sudo pacman -S qt4`.
-You can also install youtube-dl: `sudo pacman -S youtube-dl`
-
#####OpenSUSE dependencies (for Qt4 build)
- Add Packman repository for FFmpeg with all codecs (don't mix FFmpeg from different repositories!):
Files old/QMPlay2-src-16.09.04/src/gui/Icons/video-display.png and new/QMPlay2-src-16.09.21/src/gui/Icons/video-display.png differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/Main.cpp new/QMPlay2-src-16.09.21/src/gui/Main.cpp
--- old/QMPlay2-src-16.09.04/src/gui/Main.cpp 2016-09-05 01:01:06.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/Main.cpp 2016-09-21 19:20:28.000000000 +0200
@@ -18,6 +18,7 @@
#include
+#include
#include
#include
#include
@@ -45,7 +46,8 @@
#include
-static bool useGui = true;
+static ScreenSaver *g_screenSaver = NULL;
+static bool g_useGui = true;
QMPlay2GUIClass &QMPlay2GUIClass::instance()
{
@@ -163,13 +165,14 @@
QMPlay2GUIClass::QMPlay2GUIClass() :
groupIcon(NULL), mediaIcon(NULL), folderIcon(NULL),
- mainW(NULL)
+ mainW(NULL),
+ screenSaver(NULL)
{
- qmp2Pixmap = useGui ? new QPixmap(":/QMPlay2") : NULL;
+ qmp2Pixmap = g_useGui ? new QPixmap(":/QMPlay2") : NULL;
}
QMPlay2GUIClass::~QMPlay2GUIClass()
{
- if (useGui)
+ if (g_useGui)
{
delete qmp2Pixmap;
deleteIcons();
@@ -286,19 +289,26 @@
static bool qAppOK;
static bool canDeleteApp = true;
#endif
+
#include
-static void signal_handler(int s)
+
+static inline void forceKill()
{
#ifdef Q_OS_WIN
const int SC = SIGBREAK;
#else
const int SC = SIGKILL;
#endif
+ delete g_screenSaver;
+ raise(SC);
+}
+static void signal_handler(int s)
+{
switch (s)
{
case SIGINT:
if (!qApp)
- raise(SC);
+ forceKill();
else
{
QWidget *modalW = QApplication::activeModalWidget();
@@ -308,32 +318,32 @@
QMPlay2GUI.mainW = NULL;
}
else
- raise(SC);
+ forceKill();
}
break;
case SIGABRT:
#ifdef QT5_NOT_WIN
- if (!qAppOK && useGui)
+ if (!qAppOK && g_useGui)
{
- canDeleteApp = useGui = false;
+ canDeleteApp = g_useGui = false;
longjmp(env, 1);
}
#endif
QMPlay2Core.log("QMPlay2 has been aborted (SIGABRT)", ErrorLog | AddTimeToLog | (qApp ? SaveLog : DontShowInGUI));
#ifndef Q_OS_WIN
- raise(SC);
+ forceKill();
#endif
break;
case SIGFPE:
QMPlay2Core.log("QMPlay2 crashes (SIGFPE)", ErrorLog | AddTimeToLog | (qApp ? SaveLog : DontShowInGUI));
#ifndef Q_OS_WIN
- raise(SC);
+ forceKill();
#endif
break;
case SIGSEGV:
QMPlay2Core.log("QMPlay2 crashes (SIGSEGV)", ErrorLog | AddTimeToLog | (qApp ? SaveLog : DontShowInGUI));
#ifndef Q_OS_WIN
- raise(SC);
+ forceKill();
#endif
break;
}
@@ -368,21 +378,27 @@
}
#endif
+static void unblockScreenSaver()
+{
+ delete g_screenSaver;
+}
+
int main(int argc, char *argv[])
{
signal(SIGINT, signal_handler);
signal(SIGABRT, signal_handler);
signal(SIGFPE, signal_handler);
signal(SIGSEGV, signal_handler);
+ atexit(unblockScreenSaver);
#ifdef Q_WS_X11
- useGui = getenv("DISPLAY");
+ g_useGui = getenv("DISPLAY");
#endif
#ifdef QT5_NOT_WIN
if (!setjmp(env))
#endif
#if QT_VERSION < 0x050000
- new QApplication(argc, argv, useGui);
+ new QApplication(argc, argv, g_useGui);
#else
new QApplication(argc, argv);
#endif
@@ -407,7 +423,7 @@
if (socket.open(IPCSocket::WriteOnly))
{
if (writeToSocket(socket))
- useGui = false;
+ g_useGui = false;
socket.close();
}
#ifndef Q_OS_WIN
@@ -419,7 +435,7 @@
}
#endif
- if (!useGui)
+ if (!g_useGui)
{
#ifdef QT5_NOT_WIN
if (canDeleteApp)
@@ -472,8 +488,11 @@
QDir::setCurrent(QCoreApplication::applicationDirPath()); //Is it really needed?
- if (useGui)
+ if (g_useGui)
+ {
+ QMPlay2GUI.screenSaver = g_screenSaver = new ScreenSaver;
QApplication::setQuitOnLastWindowClosed(false);
+ }
#ifdef Q_OS_WIN
HHOOK keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, MMKeysHookProc, GetModuleHandle(NULL), 0);
@@ -593,6 +612,9 @@
UnhookWindowsHookEx(keyboardHook);
#endif
+ delete g_screenSaver;
+ g_screenSaver = NULL;
+
#ifdef QT5_NOT_WIN
if (canDeleteApp)
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/Main.hpp new/QMPlay2-src-16.09.21/src/gui/Main.hpp
--- old/QMPlay2-src-16.09.04/src/gui/Main.hpp 2016-09-02 01:58:21.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/Main.hpp 2016-09-21 19:03:43.000000000 +0200
@@ -26,6 +26,7 @@
class VideoAdjustment;
class ShortcutHandler;
+class ScreenSaver;
class IPCServer;
class VideoDock;
class MenuBar;
@@ -67,6 +68,7 @@
MenuBar *menuBar;
QWidget *mainW;
IPCServer *pipe;
+ ScreenSaver *screenSaver;
VideoAdjustment *videoAdjustment;
ShortcutHandler *shortcutHandler;
bool restartApp, removeSettings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/MainWidget.cpp new/QMPlay2-src-16.09.21/src/gui/MainWidget.cpp
--- old/QMPlay2-src-16.09.04/src/gui/MainWidget.cpp 2016-09-02 02:17:33.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/MainWidget.cpp 2016-09-21 19:04:00.000000000 +0200
@@ -48,6 +48,7 @@
#include
#include
#include
+#include
using Functions::timeToStr;
@@ -333,15 +334,6 @@
QMPlay2GUI.menuBar->setKeyShortcuts();
- fullScreenDockWidgetState = settings.getByteArray("MainWidget/FullScreenDockWidgetState");
-#if defined Q_OS_MAC || defined Q_OS_ANDROID
- show();
-#else
- setVisible(settings.getBool("MainWidget/isVisible", true) ? true : !(QSystemTrayIcon::isSystemTrayAvailable() && tray->isVisible()));
-#endif
-
- playlistDock->load(QMPlay2Core.getSettingsDir() + "Playlist.pls");
-
volW->setVolume(settings.getInt("VolumeL"), settings.getInt("VolumeR"), true);
if (settings.getBool("Mute"))
menuBar->player->toggleMute->trigger();
@@ -354,6 +346,15 @@
if (settings.getBool("RestoreVideoEqualizer"))
QMPlay2GUI.videoAdjustment->restoreValues();
+ fullScreenDockWidgetState = settings.getByteArray("MainWidget/FullScreenDockWidgetState");
+#if defined Q_OS_MAC || defined Q_OS_ANDROID
+ show();
+#else
+ setVisible(settings.getBool("MainWidget/isVisible", true) ? true : !(QSystemTrayIcon::isSystemTrayAvailable() && tray->isVisible()));
+#endif
+
+ playlistDock->load(QMPlay2Core.getSettingsDir() + "Playlist.pls");
+
bool noplay = false;
while (!QMPArguments.first.isEmpty())
{
@@ -918,6 +919,8 @@
menuBar->window->toggleFullScreen->setShortcuts(QList<QKeySequence>() << menuBar->window->toggleFullScreen->shortcut() << QKeySequence("ESC"));
fullScreen = true;
showFullScreen();
+
+ QMPlay2GUI.screenSaver->block();
}
else
{
@@ -969,6 +972,8 @@
playlistDock->scrollToCurrectItem();
visibleQMPlay2Extensions.clear();
+
+ QMPlay2GUI.screenSaver->unblock();
}
QMPlay2Core.fullScreenChanged(fullScreen);
}
@@ -1268,6 +1273,11 @@
}
}
+bool MainWidget::getFullScreen() const
+{
+ return fullScreen;
+}
+
void MainWidget::mouseMoveEvent(QMouseEvent *e)
{
if ((fullScreen || isCompactView) && (e->buttons() == Qt::NoButton || videoDock->isTouch))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/MainWidget.hpp new/QMPlay2-src-16.09.21/src/gui/MainWidget.hpp
--- old/QMPlay2-src-16.09.04/src/gui/MainWidget.hpp 2016-09-02 02:17:13.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/MainWidget.hpp 2016-09-17 22:55:14.000000000 +0200
@@ -44,6 +44,7 @@
class MainWidget : public QMainWindow
{
friend class QMPlay2GUIClass;
+ Q_PROPERTY(bool fullScreen READ getFullScreen)
Q_OBJECT
public:
MainWidget(QPair &);
@@ -123,6 +124,8 @@
void hideDocks();
void restoreFocus();
+ bool getFullScreen() const;
+
void mouseMoveEvent(QMouseEvent *);
void leaveEvent(QEvent *);
void closeEvent(QCloseEvent *);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/PlayClass.cpp new/QMPlay2-src-16.09.21/src/gui/PlayClass.cpp
--- old/QMPlay2-src-16.09.04/src/gui/PlayClass.cpp 2016-09-02 18:42:22.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/PlayClass.cpp 2016-09-21 18:34:28.000000000 +0200
@@ -25,7 +25,6 @@
#include
#include
-#include
#include
#include
#include
@@ -122,14 +121,6 @@
doSuspend = false;
- screenSaverLastT = Functions::gettime();
- screenSaver = new ScreenSaver;
- if (!screenSaver->isOk())
- {
- delete screenSaver;
- screenSaver = NULL;
- }
-
connect(&timTerminate, SIGNAL(timeout()), this, SLOT(timTerminateFinished()));
connect(this, SIGNAL(aRatioUpdate(double)), this, SLOT(aRatioUpdated(double)));
connect(this, SIGNAL(frameSizeUpdate(int, int)), this, SLOT(frameSizeUpdated(int, int)));
@@ -137,9 +128,7 @@
connect(this, SIGNAL(audioParamsUpdate(quint8, quint32)), this, SLOT(audioParamsUpdated(quint8, quint32)));
}
PlayClass::~PlayClass()
-{
- delete screenSaver;
-}
+{}
void PlayClass::play(const QString &_url)
{
@@ -240,23 +229,15 @@
void PlayClass::chPos(double newPos, bool updateGUI)
{
- if (screenSaver && (QMPlay2GUI.mainW->isFullScreen() || hasVideoStream()))
+ if (canUpdatePos)
{
- const double t = Functions::gettime();
- if (t - screenSaverLastT >= 0.75)
- {
- QMetaObject::invokeMethod(screenSaver, "reset");
- screenSaverLastT = t;
- }
+ if ((updateGUI || pos == -1) && ((int)newPos != (int)pos))
+ emit updatePos(newPos);
+ pos = newPos;
+ lastSeekTo = SEEK_NOWHERE;
+ if (seekA >= 0 && seekB > seekA && pos >= seekB) //A-B Repeat
+ seek(seekA);
}
- if (!canUpdatePos)
- return;
- if ((updateGUI || pos == -1) && ((int)newPos != (int)pos))
- emit updatePos(newPos);
- pos = newPos;
- lastSeekTo = SEEK_NOWHERE;
- if (seekA >= 0 && seekB > seekA && pos >= seekB) //A-B Repeat
- seek(seekA);
}
void PlayClass::togglePause()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/PlayClass.hpp new/QMPlay2-src-16.09.21/src/gui/PlayClass.hpp
--- old/QMPlay2-src-16.09.04/src/gui/PlayClass.hpp 2016-08-19 18:29:34.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/PlayClass.hpp 2016-09-21 19:02:02.000000000 +0200
@@ -30,7 +30,6 @@
#include <QWaitCondition>
class QMPlay2_OSD;
-class ScreenSaver;
class DemuxerThr;
class VideoThr;
class AudioThr;
@@ -81,6 +80,7 @@
{
doSilenceOnStart = true;
}
+
private:
inline bool hasVideoStream();
inline bool hasAudioStream();
@@ -142,9 +142,6 @@
#endif
LibASS *ass;
- double screenSaverLastT;
- ScreenSaver *screenSaver;
-
QMutex osdMutex, subsMutex;
QMPlay2_OSD *osd;
int videoWinW, videoWinH;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/ScreenSaver.cpp new/QMPlay2-src-16.09.21/src/gui/ScreenSaver.cpp
--- old/QMPlay2-src-16.09.04/src/gui/ScreenSaver.cpp 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/ScreenSaver.cpp 2016-09-21 21:01:29.000000000 +0200
@@ -11,29 +11,48 @@
{
public:
inline ScreenSaverPriv() :
- disp(NULL)
+ m_disp(NULL)
{}
inline ~ScreenSaverPriv()
{
- if (disp)
- XCloseDisplayFunc(disp);
+ if (m_disp)
+ XCloseDisplayFunc(m_disp);
+ }
+
+ inline void block()
+ {
+ int interval, preferBlanking, allowExposures;
+ XGetScreenSaverFunc(m_disp, m_timeout, interval, preferBlanking, allowExposures);
+ XSetScreenSaverFunc(m_disp, 0, interval, preferBlanking, allowExposures);
+ XFlushFunc(m_disp);
+ }
+ inline void unblock()
+ {
+ int tmpTimeout, interval, preferBlanking, allowExposures;
+ XGetScreenSaverFunc(m_disp, tmpTimeout, interval, preferBlanking, allowExposures);
+ XSetScreenSaverFunc(m_disp, m_timeout, interval, preferBlanking, allowExposures);
+ XFlushFunc(m_disp);
}
typedef void *(*XOpenDisplayType)(const char *name);
- typedef int (*XResetScreenSaverType)(void *dpy);
+ typedef int (*XGetScreenSaverType)(void *dpy, int &timeout, int &interval, int &preferBlanking, int &allowExposures);
+ typedef int (*XSetScreenSaverType)(void *dpy, int timeout, int interval, int prefer_blanking, int allow_exposures);
typedef int (*XCloseDisplayType)(void *dpy);
typedef int (*XFlushType)(void *dpy);
XOpenDisplayType XOpenDisplayFunc;
- XResetScreenSaverType XResetScreenSaverFunc;
+ XGetScreenSaverType XGetScreenSaverFunc;
+ XSetScreenSaverType XSetScreenSaverFunc;
XCloseDisplayType XCloseDisplayFunc;
XFlushType XFlushFunc;
- void *disp;
+ void *m_disp;
+ int m_timeout;
};
ScreenSaver::ScreenSaver() :
- priv(new ScreenSaverPriv)
+ m_priv(new ScreenSaverPriv),
+ m_ref(0)
{
#if QT_VERSION >= 0x050000
if (QGuiApplication::platformName() != "xcb")
@@ -42,28 +61,31 @@
QLibrary libX11("X11");
if (libX11.load())
{
- priv->XOpenDisplayFunc = (ScreenSaverPriv::XOpenDisplayType)libX11.resolve("XOpenDisplay");
- priv->XResetScreenSaverFunc = (ScreenSaverPriv::XResetScreenSaverType)libX11.resolve("XResetScreenSaver");
- priv->XFlushFunc = (ScreenSaverPriv::XFlushType)libX11.resolve("XFlush");
- priv->XCloseDisplayFunc = (ScreenSaverPriv::XCloseDisplayType)libX11.resolve("XCloseDisplay");
- if (priv->XOpenDisplayFunc && priv->XResetScreenSaverFunc && priv->XFlushFunc && priv->XCloseDisplayFunc)
- priv->disp = priv->XOpenDisplayFunc(NULL);
+ m_priv->XOpenDisplayFunc = (ScreenSaverPriv::XOpenDisplayType)libX11.resolve("XOpenDisplay");
+ m_priv->XGetScreenSaverFunc = (ScreenSaverPriv::XGetScreenSaverType)libX11.resolve("XGetScreenSaver");
+ m_priv->XSetScreenSaverFunc = (ScreenSaverPriv::XSetScreenSaverType)libX11.resolve("XSetScreenSaver");
+ m_priv->XFlushFunc = (ScreenSaverPriv::XFlushType)libX11.resolve("XFlush");
+ m_priv->XCloseDisplayFunc = (ScreenSaverPriv::XCloseDisplayType)libX11.resolve("XCloseDisplay");
+ if (m_priv->XOpenDisplayFunc && m_priv->XGetScreenSaverFunc && m_priv->XSetScreenSaverFunc && m_priv->XFlushFunc && m_priv->XCloseDisplayFunc)
+ m_priv->m_disp = m_priv->XOpenDisplayFunc(NULL);
}
}
ScreenSaver::~ScreenSaver()
{
- delete priv;
+ if (m_ref > 0)
+ m_priv->unblock();
+ delete m_priv;
}
-bool ScreenSaver::isOk() const
+void ScreenSaver::block()
{
- return priv->disp;
+ if (m_priv->m_disp && m_ref++ == 0)
+ m_priv->block();
}
-
-void ScreenSaver::reset()
+void ScreenSaver::unblock()
{
- priv->XResetScreenSaverFunc(priv->disp);
- priv->XFlushFunc(priv->disp);
+ if (m_priv->m_disp && --m_ref == 0)
+ m_priv->unblock();
}
#elif defined(Q_OS_WIN)
@@ -74,12 +96,7 @@
static inline bool blockScreenSaver(MSG *msg, bool &blocked)
{
- if (msg->message == WM_SYSCOMMAND && ((msg->wParam & 0xFFF0) == SC_SCREENSAVE || (msg->wParam & 0xFFF0) == SC_MONITORPOWER) && blocked)
- {
- blocked = false;
- return true;
- }
- return false;
+ return (blocked && msg->message == WM_SYSCOMMAND && ((msg->wParam & 0xFFF0) == SC_SCREENSAVE || (msg->wParam & 0xFFF0) == SC_MONITORPOWER));
}
#if QT_VERSION >= 0x050000
@@ -102,18 +119,25 @@
};
ScreenSaver::ScreenSaver() :
- priv(new ScreenSaverPriv)
+ m_priv(new ScreenSaverPriv),
+ m_ref(0)
{
- qApp->installNativeEventFilter(priv);
+ qApp->installNativeEventFilter(m_priv);
}
ScreenSaver::~ScreenSaver()
{
- delete priv;
+ delete m_priv;
}
- void ScreenSaver::reset()
+ void ScreenSaver::block()
+ {
+ if (m_ref++ == 0)
+ m_priv->blocked = true;
+ }
+ void ScreenSaver::unblock()
{
- priv->blocked = true;
+ if (--m_ref == 0)
+ m_priv->blocked = false;
}
#else
static bool blocked = false;
@@ -124,38 +148,38 @@
}
ScreenSaver::ScreenSaver() :
- priv(NULL)
+ m_priv(NULL),
+ m_ref(0)
{
qApp->setEventFilter(::eventFilter);
}
ScreenSaver::~ScreenSaver()
{}
- void ScreenSaver::reset()
+ void ScreenSaver::block()
{
- blocked = true;
+ if (m_ref++ == 0)
+ blocked = true;
+ }
+ void ScreenSaver::unblock()
+ {
+ if (--m_ref == 0)
+ blocked = false;
}
#endif
-bool ScreenSaver::isOk() const
-{
- return true;
-}
-
#else
ScreenSaver::ScreenSaver() :
- priv(NULL)
+ m_priv(NULL),
+ m_ref(0)
{}
ScreenSaver::~ScreenSaver()
{}
-bool ScreenSaver::isOk() const
-{
- return false;
-}
-
-void ScreenSaver::reset()
+void ScreenSaver::block()
+{}
+void ScreenSaver::unblock()
{}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/ScreenSaver.hpp new/QMPlay2-src-16.09.21/src/gui/ScreenSaver.hpp
--- old/QMPlay2-src-16.09.04/src/gui/ScreenSaver.hpp 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/ScreenSaver.hpp 2016-09-21 19:01:33.000000000 +0200
@@ -7,18 +7,17 @@
class ScreenSaver : public QObject
{
- Q_OBJECT
Q_DISABLE_COPY(ScreenSaver)
public:
ScreenSaver();
~ScreenSaver();
- bool isOk() const;
+ void block();
+ void unblock();
-public slots:
- void reset();
private:
- ScreenSaverPriv *priv;
+ ScreenSaverPriv *m_priv;
+ qint32 m_ref;
};
#endif // SCREENSAVER_HPP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/VideoThr.cpp new/QMPlay2-src-16.09.21/src/gui/VideoThr.cpp
--- old/QMPlay2-src-16.09.04/src/gui/VideoThr.cpp 2016-09-03 00:52:46.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/VideoThr.cpp 2016-09-21 19:25:55.000000000 +0200
@@ -29,6 +29,7 @@
#include
#include
+#include
#include
#include
using Functions::gettime;
@@ -42,7 +43,7 @@
VideoThr::VideoThr(PlayClass &playC, Writer *HWAccelWriter, const QStringList &pluginsName) :
AVThread(playC, "video:", HWAccelWriter, pluginsName),
doScreenshot(false),
- deleteOSD(false), deleteFrame(false),
+ deleteOSD(false), deleteFrame(false), isScreenSaverBlocked(false),
W(0), H(0), seq(0),
sDec(NULL),
HWAccelWriter(HWAccelWriter),
@@ -51,6 +52,8 @@
VideoThr::~VideoThr()
{
QMPlay2GUI.videoAdjustment->enableControls();
+ if (isScreenSaverBlocked)
+ QMPlay2GUI.screenSaver->unblock();
delete playC.osd;
playC.osd = NULL;
delete subtitles;
@@ -551,7 +554,14 @@
{
canWrite = true;
if (lastSeq == seq && writer->readyWrite())
+ {
+ if (!isScreenSaverBlocked)
+ {
+ QMPlay2GUI.screenSaver->block();
+ isScreenSaverBlocked = true;
+ }
videoWriter()->writeVideo(videoFrame);
+ }
}
void VideoThr::screenshot(VideoFrame videoFrame)
{
@@ -584,5 +594,10 @@
}
void VideoThr::pause()
{
+ if (isScreenSaverBlocked)
+ {
+ QMPlay2GUI.screenSaver->unblock();
+ isScreenSaverBlocked = false;
+ }
writer->pause();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/VideoThr.hpp new/QMPlay2-src-16.09.21/src/gui/VideoThr.hpp
--- old/QMPlay2-src-16.09.04/src/gui/VideoThr.hpp 2016-09-03 00:50:07.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/VideoThr.hpp 2016-09-21 19:24:36.000000000 +0200
@@ -78,7 +78,7 @@
void run();
- bool deleteSubs, syncVtoA, doScreenshot, canWrite, deleteOSD, deleteFrame;
+ bool deleteSubs, syncVtoA, doScreenshot, canWrite, deleteOSD, deleteFrame, isScreenSaverBlocked;
double lastSampleAspectRatio;
int W, H;
quint32 seq;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/gui/resources.qrc new/QMPlay2-src-16.09.21/src/gui/resources.qrc
--- old/QMPlay2-src-16.09.04/src/gui/resources.qrc 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/gui/resources.qrc 2016-09-06 15:56:57.000000000 +0200
@@ -29,6 +29,7 @@
<file alias="edit-find">Icons/edit-find.png</file>
<file alias="document-properties">Icons/document-properties.png</file>
<file alias="application-x-mswinurl">Icons/application-x-mswinurl.png</file>
+ <file alias="video-display">Icons/video-display.png</file>
<file>Colors/QMPlay1_dark.QMPlay2Color</file>
</qresource>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/modules/Extensions/Extensions.cpp new/QMPlay2-src-16.09.21/src/modules/Extensions/Extensions.cpp
--- old/QMPlay2-src-16.09.04/src/modules/Extensions/Extensions.cpp 2016-09-02 16:33:12.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/modules/Extensions/Extensions.cpp 2016-09-21 20:40:49.000000000 +0200
@@ -54,7 +54,11 @@
init("YouTube/ShowAdditionalInfo", false);
init("YouTube/MultiStream", true);
init("YouTube/Subtitles", true);
- init("YouTube/youtubedl", QString());
+#ifdef Q_OS_WIN
+ init("YouTube/youtubedl", QMPlay2Core.getSettingsDir() + "youtube-dl.exe");
+#else
+ init("YouTube/youtubedl", QMPlay2Core.getSettingsDir() + "youtube-dl");
+#endif
init("YouTube/ItagVideoList", YouTubeW::getQualityPresetString(YouTubeW::_1080p60));
init("YouTube/ItagAudioList", QStringList() << "171" << "251" << "140");
init("YouTube/ItagList", QStringList() << "22" << "43" << "18");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/modules/Extensions/YouTube.cpp new/QMPlay2-src-16.09.21/src/modules/Extensions/YouTube.cpp
--- old/QMPlay2-src-16.09.04/src/modules/Extensions/YouTube.cpp 2016-09-02 16:04:53.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/modules/Extensions/YouTube.cpp 2016-09-21 20:09:04.000000000 +0200
@@ -593,7 +593,7 @@
QToolButton *qualityB = new QToolButton;
qualityB->setPopupMode(QToolButton::InstantPopup);
qualityB->setToolTip(tr("Quality"));
- qualityB->setIcon(QIcon(":/quality"));
+ qualityB->setIcon(QMPlay2Core.getIconFromTheme("video-display"));
qualityB->setMenu(qualityMenu);
qualityB->setAutoRaise(true);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/modules/Extensions/icons.qrc new/QMPlay2-src-16.09.21/src/modules/Extensions/icons.qrc
--- old/QMPlay2-src-16.09.04/src/modules/Extensions/icons.qrc 2016-09-02 16:33:12.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/modules/Extensions/icons.qrc 2016-09-06 15:55:52.000000000 +0200
@@ -4,7 +4,6 @@
<file alias="prostopleer">prostopleer.png</file>
<file alias="downloader">downloader.png</file>
<file alias="youtube">youtube.png</file>
- <file alias="quality">quality.png</file>
<file alias="lastfm">lastfm.png</file>
<file alias="radio">radio.png</file>
<file alias="video">video.png</file>
Files old/QMPlay2-src-16.09.04/src/modules/Extensions/quality.png and new/QMPlay2-src-16.09.21/src/modules/Extensions/quality.png differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/modules/OpenGL2/OpenGL2Common.cpp new/QMPlay2-src-16.09.21/src/modules/OpenGL2/OpenGL2Common.cpp
--- old/QMPlay2-src-16.09.04/src/modules/OpenGL2/OpenGL2Common.cpp 2016-09-04 15:57:30.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/modules/OpenGL2/OpenGL2Common.cpp 2016-09-19 23:17:39.000000000 +0200
@@ -572,7 +572,21 @@
* on fullscreen in Windows Vista and newer on nVidia and AMD drivers.
*/
if (preventFullscreen && QSysInfo::windowsVersion() >= QSysInfo::WV_6_0)
- w->setProperty("PreventFullscreen", true);
+ {
+ Qt::CheckState compositionEnabled = Qt::Checked;
+ if (QSysInfo::windowsVersion() <= QSysInfo::WV_6_1) //Windows 8 and 10 can't disable DWM composition
+ {
+ typedef HRESULT (WINAPI *DwmIsCompositionEnabledProc)(BOOL *pfEnabled);
+ DwmIsCompositionEnabledProc DwmIsCompositionEnabled = (DwmIsCompositionEnabledProc)GetProcAddress(GetModuleHandleA("dwmapi.dll"), "DwmIsCompositionEnabled");
+ if (DwmIsCompositionEnabled)
+ {
+ BOOL enabled = false;
+ if (DwmIsCompositionEnabled(&enabled) == S_OK && !enabled)
+ compositionEnabled = Qt::PartiallyChecked;
+ }
+ }
+ w->setProperty("preventFullscreen", (int)compositionEnabled);
+ }
#endif
}
@@ -711,10 +725,15 @@
mouseTime = currTime;
mousePos = newMousePos;
- if (canWrapMouse)
- mouseWrapped = Functions::wrapMouse(widget(), mousePos);
- else
- canWrapMouse = true;
+#if QT_VERSION >= 0x050300
+ if (e->source() == Qt::MouseEventNotSynthesized)
+#endif
+ {
+ if (canWrapMouse)
+ mouseWrapped = Functions::wrapMouse(widget(), mousePos, 1);
+ else
+ canWrapMouse = true;
+ }
setMatrix = true;
updateGL(true);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/modules/OpenGL2/OpenGL2CommonQt5.cpp new/QMPlay2-src-16.09.21/src/modules/OpenGL2/OpenGL2CommonQt5.cpp
--- old/QMPlay2-src-16.09.04/src/modules/OpenGL2/OpenGL2CommonQt5.cpp 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/modules/OpenGL2/OpenGL2CommonQt5.cpp 2016-09-17 22:53:36.000000000 +0200
@@ -28,8 +28,8 @@
{
QOffscreenSurface offscreenSurface;
offscreenSurface.create();
- glCtx.makeCurrent(&offscreenSurface);
- testGLInternal();
+ if ((isOK = glCtx.makeCurrent(&offscreenSurface)))
+ testGLInternal();
}
return isOK;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/qmplay2/Functions.cpp new/QMPlay2-src-16.09.21/src/qmplay2/Functions.cpp
--- old/QMPlay2-src-16.09.04/src/qmplay2/Functions.cpp 2016-08-16 00:15:52.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/qmplay2/Functions.cpp 2016-09-17 22:53:36.000000000 +0200
@@ -546,30 +546,30 @@
return srate;
}
-bool Functions::wrapMouse(QWidget *widget, QPoint &mousePos)
+bool Functions::wrapMouse(QWidget *widget, QPoint &mousePos, int margin)
{
const QSize winSize = widget->size();
bool doWrap = false;
- if (mousePos.x() >= winSize.width() - 1)
+ if (mousePos.x() >= winSize.width() - (margin + 1))
{
- mousePos.setX(1);
+ mousePos.setX(margin + 1);
doWrap = true;
}
- else if (mousePos.x() <= 0)
+ else if (mousePos.x() <= margin)
{
- mousePos.setX(winSize.width() - 2);
+ mousePos.setX(winSize.width() - (margin + 2));
doWrap = true;
}
- if (mousePos.y() >= winSize.height() - 1)
+ if (mousePos.y() >= winSize.height() - (margin + 1))
{
- mousePos.setY(1);
+ mousePos.setY(margin + 1);
doWrap = true;
}
- else if (mousePos.y() <= 0)
+ else if (mousePos.y() <= margin)
{
- mousePos.setY(winSize.height() - 2);
+ mousePos.setY(winSize.height() - (margin + 2));
doWrap = true;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/qmplay2/InDockW.cpp new/QMPlay2-src-16.09.21/src/qmplay2/InDockW.cpp
--- old/QMPlay2-src-16.09.04/src/qmplay2/InDockW.cpp 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/qmplay2/InDockW.cpp 2016-09-17 22:53:36.000000000 +0200
@@ -128,23 +128,30 @@
{
if (w)
{
- int mappedY = mapToParent(QPoint()).y();
+ int X = 0;
int Y = 0;
int W = width();
int H = height() + loseHeight;
+
+ const int mappedY = mapToParent(QPoint()).y();
if (mappedY < 0)
{
H += mappedY;
Y -= mappedY;
}
- if (loseHeight && w->property("PreventFullscreen").toBool())
+
+ const Qt::CheckState preventFullscreen = (Qt::CheckState)w->property("preventFullscreen").value<int>();
+ if ((preventFullscreen == Qt::Checked || (loseHeight && preventFullscreen == Qt::PartiallyChecked)) && window()->property("fullScreen").toBool())
{
+ X -= 1;
Y -= 1;
+ W += 2;
H += 2;
}
- if (w->geometry() != QRect(0, Y, W, H))
+
+ if (w->geometry() != QRect(X, Y, W, H))
{
- w->setGeometry(0, Y, W, H);
+ w->setGeometry(X, Y, W, H);
emit resized(W, H);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/qmplay2/headers/Functions.hpp new/QMPlay2-src-16.09.21/src/qmplay2/headers/Functions.hpp
--- old/QMPlay2-src-16.09.04/src/qmplay2/headers/Functions.hpp 2016-07-21 23:58:00.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/qmplay2/headers/Functions.hpp 2016-09-17 22:53:36.000000000 +0200
@@ -138,7 +138,7 @@
quint32 getBestSampleRate();
- bool wrapMouse(QWidget *widget, QPoint &mousePos);
+ bool wrapMouse(QWidget *widget, QPoint &mousePos, int margin = 0);
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-16.09.04/src/qmplay2/headers/Version.hpp new/QMPlay2-src-16.09.21/src/qmplay2/headers/Version.hpp
--- old/QMPlay2-src-16.09.04/src/qmplay2/headers/Version.hpp 2016-09-05 01:02:15.000000000 +0200
+++ new/QMPlay2-src-16.09.21/src/qmplay2/headers/Version.hpp 2016-09-21 19:54:57.000000000 +0200
@@ -19,7 +19,7 @@
#ifndef VERSION_HPP
#define VERSION_HPP
-#define QMPlay2Version "16.09.04"
+#define QMPlay2Version "16.09.21"
#define QMPlay2UserAgent ("QMPlay2/" QMPlay2Version)
#endif // VERSION_HPP
Files old/QMPlay2-src-16.09.04/src/svg/Concept/gui/video-display.svgz and new/QMPlay2-src-16.09.21/src/svg/Concept/gui/video-display.svgz differ
Files old/QMPlay2-src-16.09.04/src/svg/Concept/modules/Extensions/quality.svgz and new/QMPlay2-src-16.09.21/src/svg/Concept/modules/Extensions/quality.svgz differ