Skip to content

Commit 3242cc2

Browse files
Dave SparksAndroid (Google) Code Review
authored andcommitted
Merge "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." into froyo
2 parents 821ca51 + cad5726 commit 3242cc2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

media/libstagefright/TimedEventQueue.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
//#define LOG_NDEBUG 0
2323
#define LOG_TAG "TimedEventQueue"
2424
#include <utils/Log.h>
25+
#include <utils/threads.h>
2526

2627
#include "include/TimedEventQueue.h"
2728

2829
#include <sys/prctl.h>
2930
#include <sys/time.h>
31+
#include <sys/resource.h>
3032

3133
#include <media/stagefright/MediaDebug.h>
3234

@@ -206,6 +208,7 @@ void *TimedEventQueue::ThreadWrapper(void *me) {
206208
vm->AttachCurrentThread(&env, NULL);
207209
#endif
208210

211+
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_FOREGROUND);
209212
static_cast<TimedEventQueue *>(me)->threadEntry();
210213

211214
#ifdef ANDROID_SIMULATOR

0 commit comments

Comments
 (0)