mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Improves VDPAU dissplay preemption handling.
This commit is contained in:
parent
2733e47af7
commit
d5e111238d
21
video.c
21
video.c
@ -8321,6 +8321,8 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
|
|||||||
}
|
}
|
||||||
#endif
|
#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) {
|
while (atomic_read(&decoder->SurfacesFilled) >= VIDEO_SURFACES_MAX) {
|
||||||
struct timespec abstime;
|
struct timespec abstime;
|
||||||
|
|
||||||
@ -8353,6 +8355,7 @@ static void VdpauSyncRenderFrame(VdpauDecoder * decoder,
|
|||||||
}
|
}
|
||||||
VdpauSyncDisplayFrame();
|
VdpauSyncDisplayFrame();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!decoder->Closing) {
|
if (!decoder->Closing) {
|
||||||
VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
|
VideoSetPts(&decoder->PTS, decoder->Interlaced, frame);
|
||||||
@ -8463,13 +8466,6 @@ static void VdpauDisplayHandlerThread(void)
|
|||||||
struct timespec nowtime;
|
struct timespec nowtime;
|
||||||
VdpauDecoder *decoder;
|
VdpauDecoder *decoder;
|
||||||
|
|
||||||
if (VdpauPreemption) { // display preempted
|
|
||||||
if (VdpauPreemptionRecover()) {
|
|
||||||
usleep(15 * 1000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
decoded = 0;
|
decoded = 0;
|
||||||
pthread_mutex_lock(&VideoLockMutex);
|
pthread_mutex_lock(&VideoLockMutex);
|
||||||
for (i = 0; i < VdpauDecoderN; ++i) {
|
for (i = 0; i < VdpauDecoderN; ++i) {
|
||||||
@ -8515,6 +8511,13 @@ static void VdpauDisplayHandlerThread(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (VdpauPreemption) { // display preempted
|
||||||
|
if (VdpauPreemptionRecover()) {
|
||||||
|
clock_gettime(CLOCK_REALTIME, &VdpauFrameTime);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&VideoLockMutex);
|
pthread_mutex_lock(&VideoLockMutex);
|
||||||
VdpauSyncDisplayFrame();
|
VdpauSyncDisplayFrame();
|
||||||
pthread_mutex_unlock(&VideoLockMutex);
|
pthread_mutex_unlock(&VideoLockMutex);
|
||||||
@ -9700,6 +9703,10 @@ void VideoDrawRenderState(VideoHwDecoder * hw_decoder,
|
|||||||
uint32_t end;
|
uint32_t end;
|
||||||
VdpauDecoder *decoder;
|
VdpauDecoder *decoder;
|
||||||
|
|
||||||
|
if (VdpauPreemption) { // display preempted
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
decoder = &hw_decoder->Vdpau;
|
decoder = &hw_decoder->Vdpau;
|
||||||
if (decoder->VideoDecoder == VDP_INVALID_HANDLE) {
|
if (decoder->VideoDecoder == VDP_INVALID_HANDLE) {
|
||||||
// must be hardware decoder!
|
// must be hardware decoder!
|
||||||
|
Loading…
Reference in New Issue
Block a user