Skip to content

Commit

Permalink
[coreMuxer] Fix rounding in rescaleLavPts() resulting in jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
eumagga0x2a committed Dec 3, 2019
1 parent b878e50 commit 0135dc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion avidemux_core/ADM_coreMuxer/src/ADM_muxerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ uint64_t rescaleLavPts(uint64_t us, AVRational *scale)

db*=s;
db=(db)/1000000.; // in seconds
uint64_t i=(uint64_t)db; // round up to the closer num value
uint64_t i=(uint64_t)(db+0.49);
// round up to the closer num value
i=(i+scale->num-1)/scale->num;
i*=scale->num;
return i;
Expand Down

0 comments on commit 0135dc7

Please sign in to comment.