[vlc-devel] [Patch] [ed at fxq.nl: [vlc] Allow playback of empty character devices]

Christophe Mutricy xtophe at nxtelevision.com
Thu Oct 26 16:46:18 CEST 2006


Forward from vlc@


----- Forwarded message from Ed Schouten <ed at fxq.nl> -----

> Date: Thu, 26 Oct 2006 15:29:53 +0200
> From: Ed Schouten <ed at fxq.nl>
> Subject: [vlc] Allow playback of empty character devices
> To: vlc at videolan.org
> User-Agent: Mutt/1.5.13 (2006-08-11)
> X-Approved-By: videolan at lists.videolan.org
> Reply-To: vlc at videolan.org
> 
> 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 -
> 
> 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,
> -- 
>  Ed Schouten <ed at fxq.nl>
>  WWW: http://g-rave.nl/



----- End forwarded message -----
-- 
Xtophe

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



More information about the vlc-devel mailing list