[vlc-devel] Directory access module trapped

Enrique Osuna enrique.osuna at gmail.com
Sat Oct 6 00:20:30 CEST 2007


I think I might have found another bug.  I don't know the best way to
solve the problem.

I was doing some error testing and found that when I created a new
media descriptor with a directory (~/Movies in my case) and try to
play it with media_instance_play that AStreamPrebufferStream
(src/stream.c) gets stuck in an endless loop.

modules/access/directory.c reports that the "unable to find item in
playlist" and returns VLC_ENOOBJECT to AReadStream.  AReadStream
returns this value back to AStreamPrebufferStream and it's treated as
if no data is available, so AStreamPrebufferStream waits
STREAM_DATA_WAIT and tries again.

The way to avoid this endless loop is that I modified Read function in
directory.c to return 0 (to mimic EOF) vs VLC_ENOOBJECT.  This lets
AStreamPrebufferStream to at least try to read the directory object
and if it doesn't work it stops.

There has to be a more graceful solution, but I don't know where to
begin.  Maybe have AStreamPrebufferStream try AReadStream a
predetermined number of continuous times before erroring out.  Or try
for a predetermined delay before finally quitting, or actually
interpreting negative results from AReadStream as an error not as no
data is available?

Not sure, please see attached for changes.

Enrique
-------------- next part --------------
A non-text attachment was scrubbed...
Name: access-directory-endless-loop.patch
Type: application/octet-stream
Size: 836 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20071005/37bcdb7c/attachment.obj>


More information about the vlc-devel mailing list