[vlc-devel] [PATCH] GSoC: MTP Devices initial release
Rémi Denis-Courmont
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>
wrote:
>> + /* 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
parameter?
>> + /* Delay a bit to avoid consuming all the CPU. This is
> particularly
>> + * 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
writing."
Setting the O_NONBLOCK flag has _absolutely_ _no_ effects on a regular file
descriptor.
Non-blocking I/O works for pipes and FIFOs, sockets, terminals and
pseudo-terminals, STREAMS, and on platform-specific basis, select device
files.
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.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list