Should be ringbuffer.IsEmpty() here , not ctx->mediaengine->IsVideoEnd