From 94cefdb78044e0f9996e3032de34b690de98b708 Mon Sep 17 00:00:00 2001
From: tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Thu, 23 Jul 2009 12:34:07 +0000
Subject: - revert to 1777 - Ocean.ini and SVN properties are not reverted

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1854 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 unicode/src/media/UAudioDecoder_FFmpeg.pas     | 11 +++++------
 unicode/src/media/UAudioInput_Bass.pas         |  2 +-
 unicode/src/media/UAudioInput_Portaudio.pas    |  3 +++
 unicode/src/media/UAudioPlayback_SoftMixer.pas |  6 ++++--
 unicode/src/media/UVideo.pas                   |  6 ------
 5 files changed, 13 insertions(+), 15 deletions(-)

(limited to 'unicode/src/media')

diff --git a/unicode/src/media/UAudioDecoder_FFmpeg.pas b/unicode/src/media/UAudioDecoder_FFmpeg.pas
index 97d8a8df..2d221f40 100644
--- a/unicode/src/media/UAudioDecoder_FFmpeg.pas
+++ b/unicode/src/media/UAudioDecoder_FFmpeg.pas
@@ -378,14 +378,14 @@ begin
     // try standard format
     SampleFormat := asfS16;
   end;
-  if CodecCtx^.channels > 255 then
-    Log.LogStatus('Error: CodecCtx^.channels > 255', 'TFFmpegDecodeStream.Open');
+
   FormatInfo := TAudioFormatInfo.Create(
-    byte(CodecCtx^.channels),
+    CodecCtx^.channels,
     CodecCtx^.sample_rate,
     SampleFormat
   );
 
+
   PacketQueue := TPacketQueue.Create();
 
   // finally start the decode thread
@@ -446,9 +446,7 @@ end;
 
 function TFFmpegDecodeStream.GetLength(): real;
 begin
-  // do not forget to consider the start_time value here
-  // there is a type size mismatch warnign because start_time and duration are cint64.
-  // So, in principle there could be an overflow when doing the sum.
+  // do not forget to consider the start_time value here 
   Result := (FormatCtx^.start_time + FormatCtx^.duration) / AV_TIME_BASE;
 end;
 
@@ -645,6 +643,7 @@ end;
 function TFFmpegDecodeStream.ParseLoop(): boolean;
 var
   Packet: TAVPacket;
+  StatusPacket: PAVPacket;
   SeekTarget: int64;
   ByteIOCtx: PByteIOContext;
   ErrorCode: integer;
diff --git a/unicode/src/media/UAudioInput_Bass.pas b/unicode/src/media/UAudioInput_Bass.pas
index ad6c3818..cf292c45 100644
--- a/unicode/src/media/UAudioInput_Bass.pas
+++ b/unicode/src/media/UAudioInput_Bass.pas
@@ -95,7 +95,7 @@ var
  *   user - players associated with left/right channels
  *}
 function MicrophoneCallback(stream: HSTREAM; buffer: Pointer;
-    len: integer; inputDevice: Pointer): boolean; {$IFDEF MSWINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF}
+    len: Cardinal; inputDevice: Pointer): boolean; {$IFDEF MSWINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF}
 begin
   AudioInputProcessor.HandleMicrophoneData(buffer, len, inputDevice);
   Result := true;
diff --git a/unicode/src/media/UAudioInput_Portaudio.pas b/unicode/src/media/UAudioInput_Portaudio.pas
index 31d2882b..53080a03 100644
--- a/unicode/src/media/UAudioInput_Portaudio.pas
+++ b/unicode/src/media/UAudioInput_Portaudio.pas
@@ -95,6 +95,7 @@ var
   Error:       TPaError;
   inputParams: TPaStreamParameters;
   deviceInfo:  PPaDeviceInfo;
+  SourceIndex: integer;
 begin
   Result := false;
 
@@ -290,6 +291,8 @@ var
   sourceIndex: integer;
   sourceName:  string;
   {$ENDIF}
+  cbPolls: integer;
+  cbWorks: boolean;
 begin
   Result := false;
 
diff --git a/unicode/src/media/UAudioPlayback_SoftMixer.pas b/unicode/src/media/UAudioPlayback_SoftMixer.pas
index c87e461d..c8da6bcd 100644
--- a/unicode/src/media/UAudioPlayback_SoftMixer.pas
+++ b/unicode/src/media/UAudioPlayback_SoftMixer.pas
@@ -51,7 +51,7 @@ type
       SampleBuffer:      PByteArray;
       SampleBufferSize:  integer;
       SampleBufferCount: integer; // number of available bytes in SampleBuffer
-      SampleBufferPos:   integer;
+      SampleBufferPos:   cardinal;
 
       SourceBuffer:      PByteArray;
       SourceBufferSize:  integer;
@@ -564,8 +564,9 @@ var
   ConversionOutputSize: integer;   // max. number of converted data (= buffer size)
   ConversionOutputCount: integer;  // actual number of converted data
   SourceSize: integer;
+  RequestedSourceSize: integer;
   NeededSampleBufferSize: integer;
-  BytesNeeded: integer;
+  BytesNeeded, BytesAvail: integer;
   SourceFormatInfo, OutputFormatInfo: TAudioFormatInfo;
   SourceFrameSize, OutputFrameSize: integer;
   SkipOutputCount: integer;  // number of output-data bytes to skip
@@ -573,6 +574,7 @@ var
   FillCount: integer;  // number of bytes to fill with padding data
   CopyCount: integer;
   PadFrame: PByteArray;
+  i: integer;
 begin
   Result := -1;
 
diff --git a/unicode/src/media/UVideo.pas b/unicode/src/media/UVideo.pas
index f55690b2..35f8ab4d 100644
--- a/unicode/src/media/UVideo.pas
+++ b/unicode/src/media/UVideo.pas
@@ -697,12 +697,6 @@ begin
           0, fCodecContext^.Height,
           @(fAVFrameRGB.data), @(fAVFrameRGB.linesize));
   {$ELSE}
-  // img_convert from lib/ffmpeg/avcodec.pas is actually deprecated. 
-  // If ./configure does not find SWScale then this gives the error
-  // that the identifier img_convert is not known or similar.
-  // I think this should be removed, but am not sure whether there should
-  // be some other replacement or a warning, Therefore, I leave it for now.
-  // April 2009, mischi
   errnum := img_convert(PAVPicture(fAVFrameRGB), PIXEL_FMT_FFMPEG,
             PAVPicture(fAVFrame), fCodecContext^.pix_fmt,
             fCodecContext^.width, fCodecContext^.height);
-- 
cgit v1.2.3