Browse Source

* some cleanup in madopenal and a52

git-svn-id: trunk@4691 -
ivost 19 years ago
parent
commit
7aa88d5642
2 changed files with 10 additions and 13 deletions
  1. 0 3
      packages/extra/a52/a52.pas
  2. 10 10
      packages/extra/openal/examples/madopenal.pas

+ 0 - 3
packages/extra/a52/a52.pas

@@ -590,9 +590,6 @@ begin
       ofs := ofs + 4;
       ofs := ofs + 4;
       num := num - 4;
       num := num - 4;
     end;
     end;
-
-    //ofs := ofs + 2{channels}*(6*256){samples}*2{sample_size};
-    //num := num - 2{channels}*(6*256){samples}*2{sample_size};
   end;
   end;
 
 
   Result := ofs;
   Result := ofs;

+ 10 - 10
packages/extra/openal/examples/madopenal.pas

@@ -13,12 +13,12 @@ var
   codec_rate : Longword;
   codec_rate : Longword;
   codec_chan : Longword;
   codec_chan : Longword;
 
 
-function ogg_read_func(ptr: pointer; size, nmemb: csize_t; datasource: pointer): csize_t; cdecl;
+function source_read_func(ptr: pointer; size, nmemb: csize_t; datasource: pointer): csize_t; cdecl;
 begin
 begin
   Result := TStream(datasource).Read(ptr^, size*nmemb);
   Result := TStream(datasource).Read(ptr^, size*nmemb);
 end;
 end;
 
 
-function ogg_seek_func(datasource: pointer; offset: ogg_int64_t; whence: cint): cint; cdecl;
+function source_seek_func(datasource: pointer; offset: ogg_int64_t; whence: cint): cint; cdecl;
 begin
 begin
   case whence of
   case whence of
     {SEEK_SET} 0: TStream(datasource).Seek(offset, soFromBeginning);
     {SEEK_SET} 0: TStream(datasource).Seek(offset, soFromBeginning);
@@ -28,13 +28,13 @@ begin
   Result := 0;
   Result := 0;
 end;
 end;
 
 
-function ogg_close_func(datasource: pointer): cint; cdecl;
+function source_close_func(datasource: pointer): cint; cdecl;
 begin
 begin
   TStream(datasource).Position := 0;
   TStream(datasource).Position := 0;
   Result := 0;
   Result := 0;
 end;
 end;
 
 
-function ogg_tell_func(datasource: pointer): clong; cdecl;
+function source_tell_func(datasource: pointer): clong; cdecl;
 begin
 begin
   Result := TStream(datasource).Position;
   Result := TStream(datasource).Position;
 end;
 end;
@@ -194,7 +194,7 @@ begin
   case codec of
   case codec of
     1: // mad
     1: // mad
       begin
       begin
-        mad_decoder := mad_decoder_init(source, @ogg_read_func, @ogg_seek_func, @ogg_close_func, @ogg_tell_func);
+        mad_decoder := mad_decoder_init(source, @source_read_func, @source_seek_func, @source_close_func, @source_tell_func);
         codec_read := @mad_read;
         codec_read := @mad_read;
         codec_rate := 44100;
         codec_rate := 44100;
         codec_chan := 2;
         codec_chan := 2;
@@ -203,10 +203,10 @@ begin
 
 
     2: // oggvorbis
     2: // oggvorbis
       begin
       begin
-        ogg_callbacks.read  := @ogg_read_func;
-        ogg_callbacks.seek  := @ogg_seek_func;
-        ogg_callbacks.close := @ogg_close_func;
-        ogg_callbacks.tell  := @ogg_tell_func;
+        ogg_callbacks.read  := @source_read_func;
+        ogg_callbacks.seek  := @source_seek_func;
+        ogg_callbacks.close := @source_close_func;
+        ogg_callbacks.tell  := @source_tell_func;
 
 
         if ov_open_callbacks(source, ogg_vorbis, nil, 0, ogg_callbacks) >= 0 then
         if ov_open_callbacks(source, ogg_vorbis, nil, 0, ogg_callbacks) >= 0 then
         begin
         begin
@@ -220,7 +220,7 @@ begin
 
 
     3: // a52
     3: // a52
       begin
       begin
-        a52_decoder := a52_decoder_init(0, source, @ogg_read_func, @ogg_seek_func, @ogg_close_func, @ogg_tell_func);
+        a52_decoder := a52_decoder_init(0, source, @source_read_func, @source_seek_func, @source_close_func, @source_tell_func);
         codec_read := @a52_read;
         codec_read := @a52_read;
         codec_rate := 44100;//48000;
         codec_rate := 44100;//48000;
         codec_chan := 2;
         codec_chan := 2;