/[mldonkey]/mldonkey/src/daemon/common/commonMultimedia.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/common/commonMultimedia.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by spiralvoice, Fri Jul 22 10:58:55 2005 UTC revision 1.10 by spiralvoice, Sun Oct 16 20:42:50 2005 UTC
# Line 17  Line 17 
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *)  *)
19    
20    open Int64ops
21  open Printf2  open Printf2
22  open CommonTypes  open CommonTypes
23    
# Line 26  let input_int8 ic = Line 27  let input_int8 ic =
27  let input_int16 ic =  let input_int16 ic =
28    let i0 = input_int8  ic in    let i0 = input_int8  ic in
29    let i1 = input_int8 ic in    let i1 = input_int8 ic in
30    i0 + 256 * i1    i0 lor (i1 lsl 8)
31    
 let int32_65536 = Int64.of_int 65536  
     
32  let input_int32 ic =  let input_int32 ic =
33    let i0 = input_int16 ic in    let i0 = input_int16 ic in
34    let i1 = input_int16 ic in    let i1 = input_int16 ic in
35    let i0 = Int64.of_int i0 in    let i0 = Int64.of_int i0 in
36    let i1 = Int64.of_int i1 in    let i1 = Int64.of_int i1 in
37    Int64.add i0 (Int64.mul i1 int32_65536)    or64 i0 (left64 i1 16)
38        
39  let input_int ic =  let input_int ic =
40    let i0 = input_int16 ic in    let i0 = input_int16 ic in
41    let i1 = input_int16 ic in    let i1 = input_int16 ic in
42    i0 + i1 * 65536    i0 lor (i1 lsl 16)
43    
44  let input_string4 ic =  let input_string4 ic =
45    let s = String.create 4 in    let s = String.create 4 in
# Line 52  let print_string4 v s = Line 51  let print_string4 v s =
51    for i = 0 to 3 do    for i = 0 to 3 do
52      let c = s.[i] in      let c = s.[i] in
53      let int = int_of_char c in      let int = int_of_char c in
54      if int > 31 && int <127 then      if int > 31 && int < 127 then
55        lprint_char c        lprint_char c
56      else lprintf "[%d]" int      else lprintf "[%d]" int
57    done;    done;
# Line 563  let search_info_avi ic = Line 562  let search_info_avi ic =
562                print_int32 "dwHeight" dwHeight;                print_int32 "dwHeight" dwHeight;
563                *)                *)
564                                    
565                  seek_in ic ((Int64.to_int pos) + main_header_len +20);                  seek_in ic ((Int64.to_int pos) + main_header_len + 20);
566                  let s = input_string4 ic in                  let s = input_string4 ic in
567  (*              lprint_string4 "LIST:" s; *)  (*              lprint_string4 "LIST:" s; *)
568                  let pos_in = Int64.add pos (Int64.of_int (                  let pos_in =
569                        main_header_len +24)) in                    pos ++ Int64.of_int (main_header_len + 24) in
570                  let last_pos = Int64.add pos_in size2 in                  let last_pos = pos_in ++ size2 in
571                  iter_list pos_in last_pos                  iter_list pos_in last_pos
572                            
573                            
# Line 579  let search_info_avi ic = Line 578  let search_info_avi ic =
578              | "strl" ->              | "strl" ->
579  (*              lprintf "STREAM DESCRIPTION\n";  *)  (*              lprintf "STREAM DESCRIPTION\n";  *)
580                                    
581                  let offset = Int64.of_int 4  in                  let offset = 4L  in
582                  let pos0 = Int64.add pos offset in                  let pos0 = pos ++ offset in
583                  let end_pos0 = Int64.add pos size2 in                  let end_pos0 = pos ++ size2 in
584                  iter_list pos0 end_pos0                  iter_list pos0 end_pos0
585                            
586              | "strh" ->              | "strh" ->
# Line 639  let search_info_avi ic = Line 638  let search_info_avi ic =
638              | _ -> ()              | _ -> ()
639            end;            end;
640                        
641            iter_list (Int64.add pos (Int64.add size2 (Int64.of_int 8))) end_pos            iter_list (pos ++ size2 ++ 8L) end_pos
642          end          end
643            
644      in      in
645      let pos0 = Int64.of_int 16 in      let pos0 = 16L in
646      iter_list pos0 (Int64.add pos0 size);      iter_list pos0 (pos0 ++ size);
647  (*  lprintf "DONE\n";  *)  (*  lprintf "DONE\n";  *)
648      ()      ()
649    with    with

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26