summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2010-06-15 12:34:50 -0700
committerMarco Nelissen <marcone@google.com>2010-06-16 11:09:01 -0700
commit17e8ad9c4b8fbdebec4559702b82114fb6543b67 (patch)
tree51337195126044d8571a3d3b181a0e0a9d96a26c
parentddc43521f9e15b15edc6f7dce0965483f6a0f820 (diff)
downloadframeworks_av-17e8ad9c4b8fbdebec4559702b82114fb6543b67.zip
frameworks_av-17e8ad9c4b8fbdebec4559702b82114fb6543b67.tar.gz
frameworks_av-17e8ad9c4b8fbdebec4559702b82114fb6543b67.tar.bz2
TimedEventQueue is apparently important for glitch-free media playback, and so
having it inherit its priority from the thread that created it is a bad idea. Instead, set the priority explicitly, and bump it to slightly higher than normal. Change-Id: I01843f24905790ce2e2cde5d11a99346cfbf968d
-rw-r--r--media/libstagefright/TimedEventQueue.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/TimedEventQueue.cpp b/media/libstagefright/TimedEventQueue.cpp
index 3de8c1d..0dacb53 100644
--- a/media/libstagefright/TimedEventQueue.cpp
+++ b/media/libstagefright/TimedEventQueue.cpp
@@ -22,11 +22,13 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "TimedEventQueue"
#include <utils/Log.h>
+#include <utils/threads.h>
#include "include/TimedEventQueue.h"
#include <sys/prctl.h>
#include <sys/time.h>
+#include <sys/resource.h>
#include <media/stagefright/MediaDebug.h>
@@ -206,6 +208,7 @@ void *TimedEventQueue::ThreadWrapper(void *me) {
vm->AttachCurrentThread(&env, NULL);
#endif
+ setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_FOREGROUND);
static_cast<TimedEventQueue *>(me)->threadEntry();
#ifdef ANDROID_SIMULATOR