diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-11-10 20:33:29 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-11-11 23:55:52 -0800 |
commit | 72a0ce71285034853c1720b738db348fdcec5228 (patch) | |
tree | a0a368319fad24d6757d7af458b8884f07c5f0f8 /src/rmd_timer.c | |
parent | 371ad8abf4494837a77ab6c443c0d534652e3dbd (diff) |
*: add _us suffixes to {frame,period}time names
Make the names reflect their units of microseconds
Diffstat (limited to 'src/rmd_timer.c')
-rw-r--r-- | src/rmd_timer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rmd_timer.c b/src/rmd_timer.c index 9936860..8b2e076 100644 --- a/src/rmd_timer.c +++ b/src/rmd_timer.c @@ -52,7 +52,7 @@ static void sync_streams(ProgData *pdata, unsigned int *frame_step, struct times int avd; pthread_mutex_lock(&pdata->avd_mutex); - avd = pdata->avd + pdata->frametime; + avd = pdata->avd + pdata->frametime_us; /* There are two knobs available for keeping the video synchronized with the audio: * 1. frame_step; how many frames to encode from this frame (aka dropping frames if > 1) @@ -67,20 +67,20 @@ static void sync_streams(ProgData *pdata, unsigned int *frame_step, struct times */ if (avd < 0) { - int frames_behind = -avd / pdata->frametime; + int frames_behind = -avd / pdata->frametime_us; if (frames_behind > 0) { /* more than a whole frame behind, drop frames to catch up */ *frame_step += frames_behind; - avd += frames_behind * pdata->frametime; + avd += frames_behind * pdata->frametime_us; } else { /* less than a whole frame behind, just sleep less */ - *delay = us_to_timespec(pdata->frametime + avd); + *delay = us_to_timespec(pdata->frametime_us + avd); } } else if (avd > 0) { /* sleep longer */ - *delay = us_to_timespec(pdata->frametime + avd); + *delay = us_to_timespec(pdata->frametime_us + avd); } pdata->avd = avd; |