From 93981031aa8d542f7c6778deaba7fe62beb2af69 Mon Sep 17 00:00:00 2001 From: Johns Date: Wed, 30 Sep 2015 11:16:50 +0200 Subject: Calculate queued output surfaces and show them in info message. --- ChangeLog | 2 ++ po/de_DE.po | 6 +++++- video.c | 32 ++++++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45a0aa2..f5507a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ User johns Date: + 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. Fix bug: EnableDPMSatBlackScreen only available with USE_SCREENSAVER. - H264_EOS_TRICKSPEED and USE_MPEG_COMPLETE enabled as default. diff --git a/po/de_DE.po b/po/de_DE.po index 5e2d706..a0a32c7 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-10 21:21+0200\n" +"POT-Creation-Date: 2015-09-30 10:48+0200\n" "PO-Revision-Date: blabla\n" "Last-Translator: blabla\n" "Language-Team: blabla\n" @@ -1327,6 +1327,10 @@ msgstr "" msgid "video/vdpau: can't render mixer: %s\n" msgstr "" +#, c-format +msgid "video/vdpau: can't query status: %s\n" +msgstr "" + #, c-format msgid "video/vdpau: can't block queue: %s\n" msgstr "" diff --git a/video.c b/video.c index 3a76f08..d79e45a 100644 --- a/video.c +++ b/video.c @@ -5862,6 +5862,7 @@ static VdpChromaType VdpauChromaType; ///< best video surface chroma format /// display surface ring buffer static VdpOutputSurface VdpauSurfacesRb[OUTPUT_SURFACES_MAX]; static int VdpauSurfaceIndex; ///< current display surface +static int VdpauSurfaceQueued; ///< number of display surfaces queued static struct timespec VdpauFrameTime; ///< time of last display #ifdef USE_BITMAP @@ -8586,7 +8587,29 @@ static void VdpauDisplayFrame(void) } } // - // wait for surface visible (blocks max ~5ms) + // check how many surfaces are queued + // + VdpauSurfaceQueued = 0; + for (i = 0; i < OUTPUT_SURFACES_MAX; ++i) { + VdpPresentationQueueStatus qstatus; + + status = + VdpauPresentationQueueQuerySurfaceStatus(VdpauQueue, + VdpauSurfacesRb[(VdpauSurfaceIndex + i) % OUTPUT_SURFACES_MAX], + &qstatus, &first_time); + if (status != VDP_STATUS_OK) { + Error(_("video/vdpau: can't query status: %s\n"), + VdpauGetErrorString(status)); + break; + } + if (qstatus == VDP_PRESENTATION_QUEUE_STATUS_IDLE) { + continue; + } + // STATUS_QUEUED | STATUS_VISIBLE + VdpauSurfaceQueued++; + } + // + // wait for surface no longer visible (blocks max ~5ms) // status = VdpauPresentationQueueBlockUntilSurfaceIdle(VdpauQueue, @@ -8912,14 +8935,15 @@ static void VdpauSyncDecoder(VdpauDecoder * decoder) if (!err) { VdpauMessage(0, NULL); } - Info("video: %s%+5" PRId64 " %4" PRId64 " %3d/\\ms %3d%+d v-buf\n", + Info("video: %s%+5" PRId64 " %4" PRId64 " %3d/\\ms %3d%+d%+d v-buf\n", Timestamp2String(video_clock), abs((video_clock - audio_clock) / 90) < 8888 ? ((video_clock - audio_clock) / 90) : 8888, AudioGetDelay() / 90, (int)VideoDeltaPTS / 90, VideoGetBuffers(decoder->Stream), - (1 + decoder->Interlaced) * atomic_read(&decoder->SurfacesFilled) - - decoder->SurfaceField); + decoder->Interlaced ? 2 * atomic_read(&decoder->SurfacesFilled) + - decoder->SurfaceField : atomic_read(&decoder->SurfacesFilled), + VdpauSurfaceQueued); if (!(decoder->FramesDisplayed % (5 * 60 * 60))) { VdpauPrintFrames(decoder); } -- cgit v1.2.3