[vlc-devel] [PATCH] GSoC: MTP Devices initial release
rdenis at simphalempin.com
Tue Jan 27 13:10:46 CET 2009
On Tue, 27 Jan 2009 09:56:12 +0100, Laurent Aimar <fenrir at via.ecp.fr>
>> + /* Update default_pts to a suitable value for file access */
>> + var_Create( p_access, "file-caching",
> VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
> I think "mtp-caching" was meant here.
Maybe not. It's reading a regular file, so why create yet another caching
>> + /* Delay a bit to avoid consuming all the CPU. This is
>> + * useful when reading from an unconnected FIFO. */
>> + msleep( INPUT_ERROR_SLEEP );
> I think a poll() could be used here or maybe net_Read (like file.c) as
> you used O_NONBLOCK
There is no such thing as non-blocking I/O for _regular_ files.
Specifically, "Regular files shall always poll TRUE for reading and
Setting the O_NONBLOCK flag has _absolutely_ _no_ effects on a regular file
Non-blocking I/O works for pipes and FIFOs, sockets, terminals and
pseudo-terminals, STREAMS, and on platform-specific basis, select device
The msleep() should simply be removed, and the error should be considered
fatal and passed onto the stream layer. IIRC guess that means setting b_eof
to true and returning 0.
More information about the vlc-devel