mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:42:17 +00:00
player: do not use copysign()
Apparently this function caused weird problems to me. I have no idea why. The usage of the function looks perfectly fine to me, and even rounding issues can be excluded. In any case, getting rid of this solved my problem, and makes the code actually more readable.
This commit is contained in:
parent
50f8548b2f
commit
b0b67cdf5d
@ -986,7 +986,7 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
|
|||||||
if (av_diff * -mpctx->display_sync_drift_dir >= 0)
|
if (av_diff * -mpctx->display_sync_drift_dir >= 0)
|
||||||
new = 0;
|
new = 0;
|
||||||
if (fabs(av_diff) > max_drift)
|
if (fabs(av_diff) > max_drift)
|
||||||
new = copysign(1, av_diff);
|
new = av_diff >= 0 ? 1 : -1;
|
||||||
if (mpctx->display_sync_drift_dir != new) {
|
if (mpctx->display_sync_drift_dir != new) {
|
||||||
MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new);
|
MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new);
|
||||||
mpctx->display_sync_drift_dir = new;
|
mpctx->display_sync_drift_dir = new;
|
||||||
|
Loading…
Reference in New Issue
Block a user