diff options
Diffstat (limited to 'src/til_fb.c')
-rw-r--r-- | src/til_fb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/til_fb.c b/src/til_fb.c index 02259e8..8760b84 100644 --- a/src/til_fb.c +++ b/src/til_fb.c @@ -420,7 +420,7 @@ static inline _til_fb_page_t * _til_fb_page_get(til_fb_t *fb) /* public interface */ -til_fb_fragment_t * til_fb_page_get(til_fb_t *fb) +til_fb_fragment_t * til_fb_page_get(til_fb_t *fb, unsigned *res_delay_ticks) { _til_fb_page_t *page; @@ -428,6 +428,12 @@ til_fb_fragment_t * til_fb_page_get(til_fb_t *fb) if (!page) return NULL; + if (res_delay_ticks) { + /* TODO: handle overflows, just asserting for now until it rears its head */ + assert(page->presented_ticks >= page->submitted_ticks); + *res_delay_ticks = page->presented_ticks - page->submitted_ticks; + } + return &page->fragment.public; } |