# HG changeset patch # User reimar # Date 1302359850 0 # Node ID 5dcbfb18ad5876876dfd88697a2e5b7250023b2c # Parent 0c2838570652cb0c3d81a01f805e5988fd64907a Prefer double type for timing values. diff -r 0c2838570652 -r 5dcbfb18ad58 udp_sync.c --- a/udp_sync.c Sat Apr 09 14:11:36 2011 +0000 +++ b/udp_sync.c Sat Apr 09 14:37:30 2011 +0000 @@ -54,7 +54,7 @@ float udp_seek_threshold = 1.0; // how far off before we seek // remember where the master is in the file -static float udp_master_position = -1.0; +static double udp_master_position = -1.0; // how far off is still considered equal #define UDP_TIMING_TOLERANCE 0.02 @@ -76,7 +76,7 @@ // master_position if successful. if the master has exited, returns 1. // returns -1 on error. // otherwise, returns 0. -static int get_udp(int blocking, float *master_position) +static int get_udp(int blocking, double *master_position) { char mesg[100]; @@ -113,7 +113,7 @@ mesg[chars_received] = 0; if (strcmp(mesg, "bye") == 0) return 1; - sscanf(mesg, "%f", master_position); + sscanf(mesg, "%lf", master_position); } return 0; @@ -163,7 +163,7 @@ int master_exited = get_udp(0, &udp_master_position); while (!master_exited) { - float my_position = mpctx->sh_video->pts; + double my_position = mpctx->sh_video->pts; // if we're way off, seek to catch up if (FFABS(my_position - udp_master_position) > udp_seek_threshold) {