diff options
author | Johns <johns98@gmx.net> | 2015-09-30 11:27:10 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2015-09-30 11:27:10 +0200 |
commit | f47ee3a2018e9c64927d9a5bd892e4bbc74630e8 (patch) | |
tree | cdd9f930d6af68a7ff71cf849a445563519cbfd3 | |
parent | 93981031aa8d542f7c6778deaba7fe62beb2af69 (diff) | |
download | vdr-plugin-softhddevice-f47ee3a2018e9c64927d9a5bd892e4bbc74630e8.tar.gz vdr-plugin-softhddevice-f47ee3a2018e9c64927d9a5bd892e4bbc74630e8.tar.bz2 |
Speedup queuing output surface, when decoder buffers are full.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | video.c | 21 |
2 files changed, 15 insertions, 7 deletions
@@ -1,6 +1,7 @@ User johns Date: + Speedup queuing output surface, when decoder buffers are full. Fix bug: info shows wrong decoded video surfaces. Calculate queued output surfaces and show them in info message. Add support for new API of vdr 2.3.1. @@ -9153,10 +9153,12 @@ static void VdpauDisplayHandlerThread(void) { int i; int err; + int allfull; int decoded; struct timespec nowtime; VdpauDecoder *decoder; + allfull = 1; decoded = 0; pthread_mutex_lock(&VideoLockMutex); for (i = 0; i < VdpauDecoderN; ++i) { @@ -9171,6 +9173,7 @@ static void VdpauDisplayHandlerThread(void) if (filled < VIDEO_SURFACES_MAX) { // FIXME: hot polling // fetch+decode or reopen + allfull = 0; err = VideoDecodeInput(decoder->Stream); } else { err = VideoPollInput(decoder->Stream); @@ -9193,14 +9196,18 @@ static void VdpauDisplayHandlerThread(void) if (!decoded) { // nothing decoded, sleep // FIXME: sleep on wakeup - usleep(5 * 1000); + usleep(1 * 1000); } - - clock_gettime(CLOCK_MONOTONIC, &nowtime); - // time for one frame over? - if ((nowtime.tv_sec - VdpauFrameTime.tv_sec) * 1000 * 1000 * 1000 + - (nowtime.tv_nsec - VdpauFrameTime.tv_nsec) < 15 * 1000 * 1000) { - return; + // all decoder buffers are full + // and display is not preempted + // speed up filling display queue, wait on display queue empty + if (!allfull || VdpauPreemption) { + clock_gettime(CLOCK_MONOTONIC, &nowtime); + // time for one frame over? + if ((nowtime.tv_sec - VdpauFrameTime.tv_sec) * 1000 * 1000 * 1000 + + (nowtime.tv_nsec - VdpauFrameTime.tv_nsec) < 15 * 1000 * 1000) { + return; + } } if (VdpauPreemption) { // display preempted |