summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-01-25 16:55:25 +0100
committerJohns <johns98@gmx.net>2013-01-25 16:55:25 +0100
commitd5e111238deca783d6279ff6d943bf8c1922eb75 (patch)
treeb5a6229f86ed70ef47ac841b8362735b1345366d /video.c
parent2733e47af7d8f2e7a9f28594bc09f72b224ba813 (diff)
downloadvdr-plugin-softhddevice-d5e111238deca783d6279ff6d943bf8c1922eb75.tar.gz
vdr-plugin-softhddevice-d5e111238deca783d6279ff6d943bf8c1922eb75.tar.bz2
Improves VDPAU dissplay preemption handling.
Diffstat (limited to 'video.c')
-rw-r--r--video.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/video.c b/video.c
index ef83fb0..d5573f7 100644
--- a/video.c
+++ b/video.c
@@ -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!