From 3dc26d2e5c5b360f844ea23c3f60ea4178f6f883 Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 23 Jul 2009 14:42:01 +0000 Subject: merge with current trunk revision 1827 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1855 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/media/UAudioDecoder_FFmpeg.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'unicode/src/media/UAudioDecoder_FFmpeg.pas') 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; -- cgit v1.2.3