From 820c2461483cf380226fca410e723557c106a027 Mon Sep 17 00:00:00 2001 From: Johns Date: Thu, 5 Jan 2012 22:55:57 +0100 Subject: Fix bug: old surface stay in video ringbuffer. --- video.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/video.c b/video.c index fa4da98..2e46751 100644 --- a/video.c +++ b/video.c @@ -1146,6 +1146,7 @@ static void VaapiCleanup(VaapiDecoder * decoder) { int filled; VASurfaceID surface; + int i; // flush output queue, only 1-2 frames buffered, no big loss while ((filled = atomic_read(&decoder->SurfacesFilled))) { @@ -1169,6 +1170,11 @@ static void VaapiCleanup(VaapiDecoder * decoder) abort(); } + // clear ring buffer + for (i = 0; i < VIDEO_SURFACES_MAX; ++i) { + decoder->SurfacesRb[i] = VA_INVALID_ID; + } + decoder->WrongInterlacedWarned = 0; // cleanup image -- cgit v1.2.3