Hi Martin,

> extern mpg_id mpg_open(int next_byte(mpg_id self),
>                        int tag_handler(mpg_id self,
>                                        int tag,
>                                        int next_byte(mpg_id self),
>                                        size_t size),
>                        mpg_options *p);
> 
> /* Opens an mpg decoding stream.
>    On failure it returns -1.
>    The return value can be used in successive mpg_read and
>    mpg_close calls.
> 
>    The parameters:
> 
>    next_byte is a function that will deliver the next unsigned char
>    (0-255) cast to an int from the mp3 stream. It may return -1 on end
>    of file or error. The parameter self can be used to identify the
>    stream in case there are multiple open streams at the same time.
>    In the simplest case this might, for example, be the
>    function int next_byte(mpg_id self) { return getchar(); }.

Wouldn't it be better to replace next_byte by something like

int next_chunk(mpg_id self, int buffersize, unsigned char* buffer)

(returning of course the number of bytes actually written to the buffer)?
It seems to me that calling a function for every byte of data
is rather bad for the performance. Best,

Martin

------------------------------------------------------------
D�partement de Physique Th�orique
24, Ernest Ansermet     Homepage: http://mpej.unige.ch/~hairer/
CH-1211 Gen�ve 4        EMail: [EMAIL PROTECTED]
Switzerland             Tel.: ++41 22 702 63 84
------------------------------------------------------------

_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder

Reply via email to