[fpc-pascal] How to use pipes ?

fredvs fiens at hotmail.com
Wed Feb 1 19:55:54 CET 2017

Ho Andrew, nice to read you. ;-)

I battle hard to use your Thttpgetter for Opus, like you did for mpg123.

The difference with mpg123 is that Opus needs a buffer (mpg123 a named

I am nearly sure that the problem comes from my code to get the buffer from
the pipe:

  while (outst2 < FramesWanted)  and (outst > 0)  do 
     outst := InPipe.Read(BufferTemp[0],FramesWanted-outst2); 
    if outst > 0 then  for i := 0 to outst -1 do 
   BufferURL[i+outst2] := BufferTemp[i] ; 
     outst2 := outst2 + outst; 

> Where is it stopping?

In the main loop, it is stopping a legal way, after +- 10 loops, because
Outframes =  0:
Outframes := op_read_float(HandleOP,  @Buffer[0], FramesWanted , nil); 
if Outframes = 0 then exit;

> You are blocking processing data but the buffer from the kernel is full.
> On many Linux pc's the kernel buffer size is 65536 bytes. 

Yes, it seems that this is the problem (but how to solve that?)



Many thanks ;-)
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-to-use-pipes-tp5727538p5727546.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.

More information about the fpc-pascal mailing list