diff options
author | s_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-06-29 01:02:40 +0000 |
---|---|---|
committer | s_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-06-29 01:02:40 +0000 |
commit | 1ed2c76ecb3f7351b9194356623bbad2f1313aa8 (patch) | |
tree | 5d3df5062c8f76fa419d05a383e29fa68510845f /cmake/src/media/UAudioDecoder_FFmpeg.pas | |
parent | 94b6070c9a28db1d7ba5116a6580bff8e991ff75 (diff) | |
download | usdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.tar.gz usdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.tar.xz usdx-1ed2c76ecb3f7351b9194356623bbad2f1313aa8.zip |
merged svn trunk r1837 into cmake branche
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1838 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | cmake/src/media/UAudioDecoder_FFmpeg.pas | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/src/media/UAudioDecoder_FFmpeg.pas b/cmake/src/media/UAudioDecoder_FFmpeg.pas index f62cb92c..97d8a8df 100644 --- a/cmake/src/media/UAudioDecoder_FFmpeg.pas +++ b/cmake/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; |