Mercurial > mplayer.hg
changeset 33485:2f8dc5fbec77
Partially revert r33242: it was broken, instead of continuing to
play at normal speed playback started at maximum possible speed.
author | reimar |
---|---|
date | Wed, 08 Jun 2011 18:25:17 +0000 |
parents | 4f940d7917f0 |
children | e46989c7f47e |
files | udp_sync.c |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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