[vlc] Re: patches

Derk-Jan Hartman hartman at videolan.org
Thu Jul 29 17:57:01 CEST 2004


vlc-devel usually is the best place to sent patches

1st: Apparently there is some confusion over what is the correct way. 
We wil now do as Apple, who 1st try byte (char) [seems the BSD way] and 
then fallback to int (windows method?)

2: in sapserver we will only try byte (char) now. it's not portable 
anyways and we aren't working much on it anymore

3: I fixed that potential divide by 0. Have a standard delay of 1 is 
not a good thing in my eyes. Actually, I'm thinking of changing this 
param to be specified in ms instead of s. If you have 50 announces a 1 
sec delay will take you 50 seconds to update all your announces. That 
might be a bit much for some. Anyways not really a prioriy.
Could you please investigate a bit further what the problem is with 
usleep? I'd rather not replace it. I found something in google about an 
old bug in NetBSD that would cause usleep to return immediately if the 
input value was too large. Could you try to see if this may be the 
problem?

4: vcdx fixed. :)

Thank you for pointing out these issues. More patches to fix NetBSD 
issues are always welcomed ...
DJ


On 28 jul 2004, at 21:43, Emmanuel Dreyfus wrote:
> Hi
>
> Is it the right place to submit patches?
>
> vlc, vls and sapserver all have a build bug on NetBSD: setsockopt with
> IP_MULTICAST_TTL takes a byte and not an int. It might be okay on some 
> systems,
> but NetBSD will return EINVAL if an int is given instead of a byte.
>
> For vlc:
> --- modules/misc/network/ipv4.c.orig    Tue Jul 27 19:01:35 2004
> +++ modules/misc/network/ipv4.c Tue Jul 27 19:02:52 2004
> @@ -405,9 +405,13 @@
>  #if !defined( UNDER_CE ) && !defined( SYS_BEOS )
>          if( IN_MULTICAST( ntohl(inet_addr(psz_server_addr) ) ) )
>          {
>              /* set the time-to-live */
> +#ifdef __NetBSD__
> +            unsigned char ttl = p_socket->i_ttl;
> +#else
>              int ttl = p_socket->i_ttl;
> +#endif
>              if( ttl < 1 )
>              {
>                  ttl = config_GetInt( p_this, "ttl" );
>              }
>
> for sapserver:
> --- broadcast.h.orig    Tue Jul 27 17:56:37 2004
> +++ broadcast.h Tue Jul 27 17:57:05 2004
> @@ -40,6 +40,10 @@
>      struct sockaddr_in addr;    /* IP Address to broadcast to */
>      struct sockaddr_in6 addr_v6; /* IPv6 Address to broadcast to */
>      char* group;
>      uint16_t port;
> +#ifdef __NetBSD__
> +    unsigned char ttl;
> +#else
>      unsigned int ttl;
> +#endif
>  };
>
>
> I did not made the patch in vls, but it's the same bug and it's quite
> straightforward to fix (grep IP_MULTICAST_TTL in the sources and 
> replace the int
> by a char)
>
> In sapserver, I also have a problem with the server that sends 
> announces
> continuously, because usleep does not sleep at all (no idea why). I 
> sleep at
> least 1 second, it makes no sense to sleep less:
>
> --- sapserver.cpp.orig  Tue Jul 27 18:13:01 2004
> +++ sapserver.cpp       Tue Jul 27 18:14:06 2004
> @@ -174,9 +174,13 @@
>                  if(config->GetDotMode())
>                     fprintf(stdout,".");
>
>                  /* Wait for next sending */
> +#ifdef __NetBSD__
> +               sleep(1 + 
> (config->GetDelay()/config->Programs.size()));
> +#else
>                  
> usleep(config->GetDelay()*1000000/config->Programs.size());
> +#endif
>              }
>              fflush(stdout);
>          }
>      }
>
> Now a simple one: this fixes the build on NetBSD:
>
> --- work/vlc-0.7.2/modules/access/vcdx/access.c.orig    Mon Jul 26 
> 22:00:41 2004
> +++ work/vlc-0.7.2/modules/access/vcdx/access.c Mon Jul 26 21:49:02 
> 2004
> @@ -1510,9 +1510,9 @@
>          msg_Warn( p_input, "could not open %s", psz_source );
>          goto err_exit;
>      }
>
> -    p_vcd->b_svd= vcdinfo_get_tracksSVD(p_vcd->vcd);;
> +    p_vcd->b_svd= (bool)vcdinfo_get_tracksSVD(p_vcd->vcd);;
>
>      /* Get track information. */
>      p_vcd->num_tracks = ioctl_GetTracksMap( VLC_OBJECT(p_input),
>                                              
> vcdinfo_get_cd_image(p_vcd->vcd),
>
>
> There are other problems but I don't have a simple fix for them yet.
>
> -- 
> Emmanuel Dreyfus
> Il y a 10 sortes de personnes dans le monde: ceux qui comprennent
> le binaire et ceux qui ne le comprennent pas.
> manu at netbsd.org
>
> -- 
> This is the vlc mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://www.videolan.org/support/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>
>
>
---
Universiteit Twente
Derk-Jan Hartman (d.hartman at student.utwente dot nl)
http://home.student.utwente.nl/d.hartman

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc mailing list