[Clam-devel] Network finish reading bug

Pau Arumi parumi at iua.upf.edu
Fri Oct 19 01:53:50 PDT 2007


En/na globot ha escrit:
> Hi (again)
>
> i have something strange on network players...
> i call a network with the Start() function, evrything is fine, but 
> when the file end i got a 100% cpu usage and i can't Stop() the 
> network. The result is that my prog freez waiting for the end of the 
> Network
>
> On NetworkEditor it look like the same, i play a file and in the end, 
> 100% cpu usage, and if i click stop or play button evrything freeze
>
> But if i call MultiChannelAudioFileReader::Stop() after the end of the 
> file, the CPU usage fall to 0%
>
> so i think there is a something wild in AudioFileIO or Reader Class ...
>
> ------------------------------------------------------------------------
>
> secondo, When the file reader has finish reading a file, the last 
> value of Current Time is not the Duration of the file as it should be 
> in my opinion.
> And the file reader + network doesn't seemed to stop.
>
> I made a small patch to stop the file player when reach EOF 
> (apparently returning FALSE is not enought)

Yes this seems a bug of MultiChannelAudioFileReader.
The expected behavior after EOF should be outputing silence without any 
disc access nor computation. But not stopping the processing as your 
patch does.
Have you tried with MonoAudioFileReder, I think it doesn't show that bug.

And have you tried to spot the cause of the bug? It seems a good time to 
fix it.


About the CurrentTime bug I have no time to go into it right now. I 
think Roman implemented it maybe he is around.
I'd be very happy if somebody can do a minimal example that reproduce 
this bug so I can incorporate it as an automatic functional test.


BTW now that we are on this subject, there is an obvius refactoring to 
be made here: unify Mono and MultiChannelAudioFileReader classes. By 
default it should create as many ports as channels have the audiofile 
(passed in the configuration).
But it should also might be configured with a fixed number of outports, 
and try to do a sensible mapping (outputting only a subset of channels 
or repeating channels, depending on the situation).
This fixed number of ports feature is useful when using a network 
outside the network editor as the user can not redo ports connections 
after choosing a file.

Cheers,
Pau






More information about the clam-devel mailing list