On Thu, Nov 24, 2016 at 10:48:38PM -0800, Dave Yeo wrote: > > On 11/24/16 07:47 PM, Kevin Lo wrote: > > Since the Linux implementation of sockaddr doesn't have sa_len as a member, > > but the FreeBSD version does, introduce a get_sa_len() function that > > determines the size based on the address family. > > > > Signed-off-by: Kevin Lo <ke...@kevlo.org> > > --- > > > > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c > > index c6292c5..4c543ed 100644 > > --- a/libavformat/rtsp.c > > +++ b/libavformat/rtsp.c > > @@ -202,6 +202,19 @@ static int get_sockaddr(AVFormatContext *s, > > return 0; > > } > > > > +static socklen_t > > +get_sa_len(struct sockaddr *addr) > > +{ > > + switch (addr->sa_family) { > > + case AF_INET: > > + return (sizeof(struct sockaddr_in)); > > + case AF_INET6: > > + return (sizeof(struct sockaddr_in6)); > > + default: > > + return (sizeof(struct sockaddr)); > > + } > > +} > > + > [...] > > Fails here (OS/2), > ... > CC libavformat/rtspdec.o > K:/usr/local/src/ffmpeg/libavformat/rtsp.c: In function 'get_sa_len': > K:/usr/local/src/ffmpeg/libavformat/rtsp.c:212:17: error: invalid > application of > 'sizeof' to incomplete type 'struct sockaddr_in6' > return (sizeof(struct sockaddr_in6)); > ^ > make: *** [libavformat/rtsp.o] Error 1 > ... > Perhaps use > #if HAVE_STRUCT_SOCKADDR_IN6 > case AF_INET6: > return (sizeof(struct sockaddr_in6)); > #endif > or such.
Thanks for pointing it out, I just resent the patch, thanks > Dave Kevin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel