[vdr] MP3-plugin problems with slow cpu

Martin Cap macap20001 at compuserve.de
Mon Jul 25 18:04:18 CEST 2005


Clemens Kirchgatterer wrote:
>>Martin Cap <macap20001 at compuserve.de> wrote:
>>
>>>Today I tried to set O_NONBLOCK to the open()-calls (the code does a
>>>
>>>"do{ r = read(...); }while(r!=-1 && r != EINTR);" at stream.c:271
>>
>>shouldn't it be: while(r!=-1 && errno != EINTR); ?
> 
> when i think about it, i'd rather do {
> 	r = read(...);
> } while (r >= 0 || ((r < 0) && (errno == EINTR)));
> 
> b.t.w. doesn't that eat cpu like crazy when O_NONBLOCK is set?
> 

Sure it does. The strange things is, it also does without O_NONBLOCK 
set. The call to read() blocks infinitely and puts CPU-usage to 99%. I 
don't know the cause for this, as I'm the only one with this strange 
behavior in combiantion with the mp3-plugin.

-- 
---
Regards,
Martin Cap



More information about the vdr mailing list