diff options
Diffstat (limited to '')
-rw-r--r-- | unicode/src/media/UAudioDecoder_FFmpeg.pas | 11 | ||||
-rw-r--r-- | unicode/src/media/UAudioInput_Bass.pas | 2 | ||||
-rw-r--r-- | unicode/src/media/UAudioInput_Portaudio.pas | 3 | ||||
-rw-r--r-- | unicode/src/media/UAudioPlayback_SoftMixer.pas | 6 | ||||
-rw-r--r-- | unicode/src/media/UVideo.pas | 6 |
5 files changed, 15 insertions, 13 deletions
diff --git a/unicode/src/media/UAudioDecoder_FFmpeg.pas b/unicode/src/media/UAudioDecoder_FFmpeg.pas index 2d221f40..97d8a8df 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( - CodecCtx^.channels, + byte(CodecCtx^.channels), CodecCtx^.sample_rate, SampleFormat ); - PacketQueue := TPacketQueue.Create(); // finally start the decode thread @@ -446,7 +446,9 @@ end; function TFFmpegDecodeStream.GetLength(): real; begin - // do not forget to consider the start_time value here + // 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. Result := (FormatCtx^.start_time + FormatCtx^.duration) / AV_TIME_BASE; end; @@ -643,7 +645,6 @@ 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 cf292c45..ad6c3818 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: Cardinal; inputDevice: Pointer): boolean; {$IFDEF MSWINDOWS}stdcall;{$ELSE}cdecl;{$ENDIF} + len: integer; 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 53080a03..31d2882b 100644 --- a/unicode/src/media/UAudioInput_Portaudio.pas +++ b/unicode/src/media/UAudioInput_Portaudio.pas @@ -95,7 +95,6 @@ var Error: TPaError; inputParams: TPaStreamParameters; deviceInfo: PPaDeviceInfo; - SourceIndex: integer; begin Result := false; @@ -291,8 +290,6 @@ 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 c8da6bcd..c87e461d 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: cardinal; + SampleBufferPos: integer; SourceBuffer: PByteArray; SourceBufferSize: integer; @@ -564,9 +564,8 @@ var ConversionOutputSize: integer; // max. number of converted data (= buffer size) ConversionOutputCount: integer; // actual number of converted data SourceSize: integer; - RequestedSourceSize: integer; NeededSampleBufferSize: integer; - BytesNeeded, BytesAvail: integer; + BytesNeeded: integer; SourceFormatInfo, OutputFormatInfo: TAudioFormatInfo; SourceFrameSize, OutputFrameSize: integer; SkipOutputCount: integer; // number of output-data bytes to skip @@ -574,7 +573,6 @@ 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 35f8ab4d..f55690b2 100644 --- a/unicode/src/media/UVideo.pas +++ b/unicode/src/media/UVideo.pas @@ -697,6 +697,12 @@ 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); |