Improves VDPAU dissplay preemption handling.

This commit is contained in:
Johns 2013-01-25 16:55:25 +01:00
parent 2733e47af7
commit d5e111238d
1 changed files with 14 additions and 7 deletions

21
video.c
View File

@ -8321,6 +8321,8 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
}
#endif
#if 1
// FIXME: this part code should be no longer be needed with new mpeg fix
while (atomic_read(&decoder->SurfacesFilled) >= VIDEO_SURFACES_MAX) {
struct timespec abstime;
@ -8353,6 +8355,7 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
}
VdpauSyncDisplayFrame();
}
#endif
if (!decoder->Closing) {
VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
@ -8463,13 +8466,6 @@ static void VdpauDisplayHandlerThread(void)
struct timespec nowtime;
VdpauDecoder *decoder;
if (VdpauPreemption) { // display preempted
if (VdpauPreemptionRecover()) {
usleep(15 * 1000);
return;
}
}
decoded = 0;
pthread_mutex_lock(&VideoLockMutex);
for (i = 0; i < VdpauDecoderN; ++i) {
@ -8515,6 +8511,13 @@ static void VdpauDisplayHandlerThread(void)
return;
}
if (VdpauPreemption) { // display preempted
if (VdpauPreemptionRecover()) {
clock_gettime(CLOCK_REALTIME, &VdpauFrameTime);
return;
}
}
pthread_mutex_lock(&VideoLockMutex);
VdpauSyncDisplayFrame();
pthread_mutex_unlock(&VideoLockMutex);
@ -9700,6 +9703,10 @@ void VideoDrawRenderState(VideoHwDecoder * hw_decoder,
uint32_t end;
VdpauDecoder *decoder;
if (VdpauPreemption) { // display preempted
return;
}
decoder = &hw_decoder->Vdpau;
if (decoder->VideoDecoder == VDP_INVALID_HANDLE) {
// must be hardware decoder!