Fix bug: old surface stay in video ringbuffer.

This commit is contained in:
Johns 2012-01-05 22:55:57 +01:00
parent 8dda2a0b8a
commit 820c246148

View File

@ -1146,6 +1146,7 @@ static void VaapiCleanup(VaapiDecoder * decoder)
{ {
int filled; int filled;
VASurfaceID surface; VASurfaceID surface;
int i;
// flush output queue, only 1-2 frames buffered, no big loss // flush output queue, only 1-2 frames buffered, no big loss
while ((filled = atomic_read(&decoder->SurfacesFilled))) { while ((filled = atomic_read(&decoder->SurfacesFilled))) {
@ -1169,6 +1170,11 @@ static void VaapiCleanup(VaapiDecoder * decoder)
abort(); abort();
} }
// clear ring buffer
for (i = 0; i < VIDEO_SURFACES_MAX; ++i) {
decoder->SurfacesRb[i] = VA_INVALID_ID;
}
decoder->WrongInterlacedWarned = 0; decoder->WrongInterlacedWarned = 0;
// cleanup image // cleanup image