[MPlayer-dev-eng] [PATCH] Network synchronized playback using UDP
Diego Biurrun
diego at biurrun.de
Wed Sep 8 19:30:34 CEST 2010
On Tue, Aug 31, 2010 at 06:59:59PM -0700, Jason Holt wrote:
> > I'd like to apply it, but the patch is incomplete, it is missing udp_sync.c
> > and udp_sync.h...
>
> Thanks Diego! Sorry for the delay and the broken patch #26. The
> attached patch #27 adds checks for CONFIG_NETWORKING and
> HAVE_WINSOCK2_H. It compiles fine for me on linux with and without
> --disable-networking. And it includes udp_sync.[ch].
Thanks.
> --- mplayer.c (revision 32037)
> +++ mplayer.c (working copy)
> @@ -125,7 +125,13 @@
>
> +#ifdef CONFIG_NETWORKING
> +#include "udp_sync.h"
> +#endif /* CONFIG_NETWORKING */
useless #ifdef
> --- udp_sync.c (revision 0)
> +++ udp_sync.c (revision 0)
> @@ -0,0 +1,218 @@
> +int get_udp(int blocking, float *master_position)
> +{
> + memset(&servaddr, sizeof(servaddr), 0);
A size 0 memset looks fishy and indeed:
udp_sync.o: In function `get_udp':
udp_sync.c:(.text+0x265): warning: memset used with constant zero length parameter; this could be due to transposed parameters
> + servaddr.sin_family = AF_INET;
> + servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
> + servaddr.sin_port = htons(udp_port);
The = should be aligned.
> + if (chars_received == -1) {
> + return 0;
Indentation is off, same in other places.
Diego
More information about the MPlayer-dev-eng
mailing list