Skip to content

Commit

Permalink
- limit throttle time by min allowed frame duration = 1sec / (max dat…
Browse files Browse the repository at this point in the history
…a rate * targetFrameRate)
  • Loading branch information
igorshevach committed Nov 12, 2023
1 parent 4762d7c commit 7acde1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions transcoder/utils/throttler.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ doThrottle(float maxDataRate,
// going to sleep for a period of time gained due to race
int64_t throttleWindowUs = calculateThrottleWindow(stats,targetFramerate);
int throttleWaitUSec = (currentDataRate - maxDataRate) * throttleWindowUs;
throttleWaitUSec = __MIN(throttleWaitUSec, av_rescale(1000*1000,targetFramerate.den,targetFramerate.num) / maxDataRate);
if(throttleWaitUSec > minThrottleWaitMs * 1000) {
LOGGER(CATEGORY_THROTTLER,AV_LOG_INFO,"%s. throttling %.3f ms",
__FUNCTION__,
Expand Down

0 comments on commit 7acde1f

Please sign in to comment.