#329: Mean messes with video
------------------------+---------------------------------------------------
 Reporter:  toots       |       Owner:  admin    
     Type:  Bugs        |      Status:  new      
 Priority:  1           |   Milestone:  1.0 beta 
Component:  Liquidsoap  |     Version:  0.9.1+svn
 Keywords:              |         Mac:  1        
    Linux:  1           |      Netbsd:  1        
    Other:  1           |     Freebsd:  1        
------------------------+---------------------------------------------------

Comment(by toots):

 The following patch, which I believe is correct, trigers a segault:

 {{{
 --- conversions/mean.ml (révision 7317)
 +++ conversions/mean.ml (copie de travail)
 @@ -23,7 +23,6 @@
  open Source

  class mean ~kind (source:source) =
 -  let ctype = Frame.type_of_kind kind in
  object (self)
    inherit operator kind [source] as super

 @@ -34,12 +33,9 @@

    method private get_frame buf =
      let offset = AFrame.position buf in
 -    let moffset = Frame.position buf in
      let buffer = source#get buf ; AFrame.content buf offset in
 -    let dst = Frame.content_of_type buf moffset ctype in
 -    let dst = dst.Frame.audio.(0) in
        for i = offset to AFrame.position buf - 1 do
 -        dst.(i) <-
 +        buffer.(0).(i) <-
            Array.fold_left (fun m b -> m +. b.(i)) 0. buffer
            /. float (Array.length buffer)
        done
 }}}

 Sefgault:
 {{{
 0x00000000006f0784 in ocaml_vorbis_encode_float (vdsp=22265016,
 vogg=22264280, data=22266648, _offs=<value optimized out>, _len=<value
 optimized out>) at vorbis_stubs.c:432
 432           vorbis_buffer[c][i] = Double_field(datac, i + offs);
 (gdb) bt
 #0  0x00000000006f0784 in ocaml_vorbis_encode_float (vdsp=22265016,
 vogg=22264280, data=22266648, _offs=<value optimized out>, _len=<value
 optimized out>) at vorbis_stubs.c:432
 #1  0x000000000071aedc in caml_c_call ()
 #2  0x000000000153b728 in ?? ()
 #3  0x00000000004d1d36 in camlOgg_muxer__encode_281 ()
 }}}

 To reprocuce:
 {{{
 
output.file(%ogg(%theora,%vorbis(channels=1)),"/tmp/gni.ogv",mean(single("/tmp/bla.ogv")))
 }}}

 I do not know what to do here. More generaly, I am suspecting some kind of
 bug in the content management. There is another segfault with video (#354)
 which I have not been able to track down.

 Basically, the above code should not, if in pure ocaml code, segfault. If
 the array is to small, usual ocaml code returns an exception.

 However, we are using bindings which, purposedly, may access an array
 without these securities, in the C code of ocaml-vorbis, for instance, in
 order to optimize the code.

 Hence, it could be the case that we do not manage properly the size of the
 arrays used for the contents..

-- 
Ticket URL: <http://savonet.rastageeks.org/ticket/329#comment:7>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !
------------------------------------------------------------------------------

_______________________________________________
Savonet-trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-trac

Reply via email to