diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-06-09 16:03:49 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-06-09 16:03:49 +0400 |
commit | d93173e3af0cacc4b295e3fb2f588d6e0c59b5fe (patch) | |
tree | 8779d5810e1e300fd3640ba1bcbc28ce1a95151d /src/filters/transform | |
parent | 18187f322ca29ce4e03d27a4769e3bc214395125 (diff) |
Move the IsWin* functions into an helper class. The OS version is now cached and the function calls properly inlined.
This code was inspired by TortoiseSVN's SysInfo class.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5057 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform')
-rw-r--r-- | src/filters/transform/MPCVideoDec/FfmpegContext.cpp | 4 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp index 6f8a74ce9..2bf679e0f 100644 --- a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp +++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp @@ -31,7 +31,7 @@ #include "FfmpegContext.h"
-extern BOOL IsWinVistaOrLater(); // requires linking with DSUtil which is always the case
+#include "../../../DSUtil/SysVersion.h"
extern "C" {
#include <ffmpeg/libavcodec/dsputil.h>
@@ -165,7 +165,7 @@ int FFH264CheckCompatibility(int nWidth, int nHeight, struct AVCodecContext* pAV if (nPCIVendor == PCIV_nVidia) {
// nVidia cards support level 5.1 since drivers v6.14.11.7800 for XP and drivers v7.15.11.7800 for Vista/7
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
if (DriverVersionCheck(VideoDriverVersion, 7, 15, 11, 7800)) {
no_level51_support = 0;
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index e50781bf5..00db8ed10 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -43,6 +43,8 @@ extern "C" #include "../../../DSUtil/DSUtil.h"
#include "../../../DSUtil/MediaTypes.h"
+#include "../../../DSUtil/SysVersion.h"
+#include "../../../DSUtil/WinAPIUtils.h"
#include "../../parser/MpegSplitter/MpegSplitter.h"
#include "../../parser/OggSplitter/OggSplitter.h"
#include "../../parser/RealMediaSplitter/RealMediaSplitter.h"
@@ -50,8 +52,6 @@ extern "C" #include "DXVADecoderH264.h"
#include "../../../mpc-hc/FilterEnum.h"
-#include "../../../DSUtil/WinAPIUtils.h"
-
#define MAX_SUPPORTED_MODE 5
#define ROUND_FRAMERATE(var,FrameRate) if (labs ((long)(var - FrameRate)) < FrameRate*1/100) var = FrameRate;
#define AVRTIMEPERFRAME_VC1_EVO 417083
@@ -532,7 +532,7 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr) {
HWND hWnd = NULL;
- if (IsWinVistaOrLater()) {
+ if (SysVersion::IsVistaOrLater()) {
for (int i=0; i<_countof(ffCodecs); i++) {
if (ffCodecs[i].nFFCodec == CODEC_ID_H264) {
ffCodecs[i].DXVAModes = &DXVA_H264_VISTA;
|