[vlc] Re: Allow playback of empty character devices

Sigmund Augdal Helberg dnumgis at videolan.org
Thu Oct 26 16:48:03 CEST 2006


On Thu, 2006-10-26 at 15:29 +0200, Ed Schouten wrote:
> Hello everyone,
> 
> I'm currently working at a project at school to develop a set top box
> running FreeBSD. We're using the cxm driver for a Hauppauge TV card. The
> cxm driver creates a device, /dev/cxm0, which spits out MPEG-2 generated
> by the MPEG-2 encoder on the TV card.
> 
> VLC has a check in the file access module to fail when files are empty.
> This disallows using the following command:
> 
> $ vlc /dev/cxm0
> 
> The only thing that works:
> 
> $ cat /dev/cxm0 | vlc -
vlc stream:///dev/cxm0  should work as well. This would not need any
patch. Not saying your patch isn't applicable, but that you can live
without it. There may however be portability issues with your patch...

Sigmund

> 
> The disadvantage is that FreeBSD spends a lot of time in piperd, sending
> data from cat to vlc. The following patch adds a check to make 0 bytes
> character devices unseekable:
> 
> %%%
> --- modules/access/file.c	Sat May  6 17:52:18 2006
> +++ modules/access/file.c	Thu Oct 26 15:14:10 2006
> @@ -275,6 +275,11 @@
>          return VLC_EGENERIC;
>      }
>  
> +    if (S_ISCHR(stat_info.st_mode) && !p_access->info.i_size) {
> +        /* Allow playback of empty character devices */
> +        p_sys->b_seekable = VLC_FALSE;
> +    }
> +
>      if( p_sys->b_seekable && !p_access->info.i_size )
>      {
>          /* FIXME that's bad because all others access will be probed */
> %%%
> 
> Yours,

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html



More information about the vlc mailing list