# HG changeset patch # User reimar # Date 1307557517 0 # Node ID 2f8dc5fbec775e3fadca7a18bb9f1f36f4b35440 # Parent 4f940d7917f073369796c38fcea4ba1c047e12e4 Partially revert r33242: it was broken, instead of continuing to play at normal speed playback started at maximum possible speed. diff -r 4f940d7917f0 -r 2f8dc5fbec77 udp_sync.c --- a/udp_sync.c Tue Jun 07 15:16:22 2011 +0000 +++ b/udp_sync.c Wed Jun 08 18:25:17 2011 +0000 @@ -53,6 +53,9 @@ // (can be a broadcast address) float udp_seek_threshold = 1.0; // how far off before we seek +// remember where the master is in the file +static double udp_master_position = -1.0; + // how far off is still considered equal #define UDP_TIMING_TOLERANCE 0.02 @@ -81,9 +84,6 @@ int n; static int sockfd = -1; - - *master_position = MP_NOPTS_VALUE; - if (sockfd == -1) { struct timeval tv = { .tv_sec = 30 }; struct sockaddr_in servaddr = { 0 }; @@ -164,12 +164,10 @@ // position. returns 1 if the master tells us to exit, 0 otherwise. int udp_slave_sync(MPContext *mpctx) { - double udp_master_position; - // grab any waiting datagrams without blocking int master_exited = get_udp(0, &udp_master_position); - while (udp_master_position != MP_NOPTS_VALUE && !master_exited) { + while (!master_exited) { double my_position = mpctx->sh_video->pts; // if we're way off, seek to catch up