summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 03:00:14 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 03:00:14 +0200
commit240550bbb94653907faa6e0bb1c5ac3d279cc252 (patch)
tree1cd5346e52515dbeff187d040d79b92fae96caa9 /osdep
parent9895f2360fd5e8c48f21117d6934254317891cde (diff)
parentfbb74e16a38d6a5af31a7fb369195988f7414766 (diff)
downloadmpv-240550bbb94653907faa6e0bb1c5ac3d279cc252.tar.bz2
mpv-240550bbb94653907faa6e0bb1c5ac3d279cc252.tar.xz
Merge svn changes up to r30848
Diffstat (limited to 'osdep')
-rw-r--r--osdep/osdep.h19
-rw-r--r--osdep/priority.c25
2 files changed, 21 insertions, 23 deletions
diff --git a/osdep/osdep.h b/osdep/osdep.h
index 0a64c31120..654309c015 100644
--- a/osdep/osdep.h
+++ b/osdep/osdep.h
@@ -27,7 +27,24 @@
#define INCL_DOS
#define INCL_DOSDEVIOCTL
#include <os2.h>
-#endif
+
+#include <process.h> /* getpid() */
+
+#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
+#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
+#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
+#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
+#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
+#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
+
+#define SetPriorityClass(pid, prio) \
+ DosSetPriority(PRTYS_PROCESS, \
+ HIBYTE(prio), \
+ LOBYTE(prio), \
+ pid)
+
+#define GetCurrentProcess() getpid()
+#endif /* __OS2__ */
#endif /* MPLAYER_OSDEP_H */
diff --git a/osdep/priority.c b/osdep/priority.c
index 7a21868ddf..1f40d02c1d 100644
--- a/osdep/priority.c
+++ b/osdep/priority.c
@@ -20,23 +20,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef __OS2__
-
-#define INCL_DOS
-#include <os2.h>
-
-#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
-#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
-#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
-#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
-#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
-#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
-
-#else
+#include "osdep.h"
+#ifdef _WIN32
#include <windows.h>
-
-#endif /* __OS2__ */
+#endif
#include <string.h>
@@ -76,13 +64,6 @@ void set_priority(void)
mp_tmsg(MSGT_CPLAYER, MSGL_STATUS, "Setting process priority: %s\n",
priority_presets_defs[i].name);
-#ifdef __OS2__
- DosSetPriority(PRTYS_PROCESS,
- HIBYTE(priority_presets_defs[i].prio),
- LOBYTE(priority_presets_defs[i].prio),
- 0);
-#else
SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio);
-#endif
}
}