[vlc-devel] Re: vlc & hauppauge pvr350

Gildas Bazin gbazin at altern.org
Mon Aug 23 14:51:11 CEST 2004


On Monday 23 August 2004 14:03, Daniel Lawson wrote:
> Hi,
> 
> I'm trying to use vlc to stream (and transcode) off a Hauppauge PVR350. 
> I'm using VLC 0.7.2 in linux (debian sarge), although I've grabbed the 
> current svn vlc-trunk and it seems to be doing a similar thing.
> 
> First of all, I've set the pvr up correctly, I can capture off it via 
> vls or by doing 'cat /dev/video0 > test.mpeg'. It doesn't work with vlc.
> 
> Digging through modules/access/pvr/pvr.c, and strace()ing the running 
> program, I find it is spinning on a select() in the Read function (about 
> line 518)
> 
>     FD_ZERO( &fds );
>     FD_SET( p_sys->i_fd, &fds );
>     timeout.tv_sec = 0;
>     timeout.tv_usec = 500000;
> 
> 
>     while( !( i_ret = select( p_sys->i_fd + 1, &fds,
>                               NULL, NULL, &timeout ) ) >= 0  )
>     {   
>         FD_ZERO( &fds );
>         FD_SET( p_sys->i_fd, &fds );
>         timeout.tv_sec = 0;
>         timeout.tv_usec = 500000;
> 
>         if( p_input->b_die || p_input->b_error )
>             return 0;
>     }
> 
> This will spin on the select until it returns 0 - which will only happen 
> on a timeout. Because this is reading from a device which is always 
> providing data, it will never timeout.
> 

The actual code in the plugin is this one:

    while( !( i_ret = select( p_sys->i_fd + 1, &fds,
                                    NULL, NULL, &timeout) ) )
    {
        FD_ZERO( &fds );
        FD_SET( p_sys->i_fd, &fds );
        timeout.tv_sec = 0;
        timeout.tv_usec = 500000;

        if( p_input->b_die || p_input->b_error )
            return 0;
    }

And this will spin on the select until it returns something different from 
0! In other words, until it reads some data (or an error happens).

I don't see anything wrong with that.

If you have problems with the PVR input, you should first give a go to the 
--cr-average=10000 option.

--
Gildas

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



More information about the vlc-devel mailing list