#376: Resampling should be stateful
-------------------------+--------------------------------------------------
  Reporter:  mrpingouin  |       Owner:  admin   
      Type:  Bugs        |      Status:  reopened
  Priority:  1           |   Milestone:  1.0     
 Component:  Liquidsoap  |     Version:          
Resolution:              |    Keywords:          
       Mac:  1           |       Linux:  1       
    Netbsd:  1           |       Other:  1       
   Freebsd:  1           |  
-------------------------+--------------------------------------------------

Comment(by toots):

 Again, I do not see where you draw that conclusion from.. The line:
 {{{
 let converter = Samplerate.create quality 1 in
 }}}
 creates the converter state and the line:
 {{{
    let convert ratio b ofs len =
      Samplerate.process_alloc converter ratio b ofs len
    in
 }}}
 uses the converter to resample.

 If you want, you can look at the corresponding C code:
 {{{
 CAMLprim value ocaml_samplerate_process_alloc(value src, value _ratio,
 value _inbuf, value _inbufofs, value _inbuflen)
 {
   CAMLparam3(src, _ratio, _inbuf);
   CAMLlocal1(ans);
 (...)
   SRC_DATA data;
   SRC_STATE *state = State_val(src);
 (...)
   caml_enter_blocking_section();
   int ret = src_process(state, &data);
   caml_leave_blocking_section();
 (...)
 }}}

 Now, you may be confused by the mention of "alloc" in the name of the
 function, but in fact it denotes the fact that ocaml-resample allocates
 the output buffer in this function.

 Finally, I am all about reviewing code, I am just not sure how pertinent
 it is to use a tracking system for that purpose :-)

-- 
Ticket URL: <http://savonet.rastageeks.org/ticket/376#comment:4>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Savonet-trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-trac

Reply via email to