aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-15 16:09:25 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-15 16:09:25 +0000
commit62aea784507707eac56c5305fb191365987ae596 (patch)
tree210bd265b3100a97e2e6a688c8e4b38b91224e19
parentea281d602be3a3767b906504f14722f087a9eb6f (diff)
downloadusdx-62aea784507707eac56c5305fb191365987ae596.tar.gz
usdx-62aea784507707eac56c5305fb191365987ae596.tar.xz
usdx-62aea784507707eac56c5305fb191365987ae596.zip
resolve some type size mismatch warnings + an additional check.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1727 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/media/UAudioDecoder_FFmpeg.pas10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas
index f62cb92c..97d8a8df 100644
--- a/src/media/UAudioDecoder_FFmpeg.pas
+++ b/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;