diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-05 21:52:18 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-05 21:52:18 +0000 |
commit | dcbfb30a62776ffa128f620235a8bacf6137e0d5 (patch) | |
tree | 0dbbac586e4617d3d8a08220c308f4135353c471 | |
parent | 21e5e8cec6f253ec24b5116b4020dc62bb2a80b1 (diff) | |
download | usdx-dcbfb30a62776ffa128f620235a8bacf6137e0d5.tar.gz usdx-dcbfb30a62776ffa128f620235a8bacf6137e0d5.tar.xz usdx-dcbfb30a62776ffa128f620235a8bacf6137e0d5.zip |
- bugfix: tried to access array element -1 if video contained no audio-stream
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@670 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UVideo.pas | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index 65dbc0a2..6c9458f9 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -487,7 +487,11 @@ begin writeln( 'VideoStreamIndex : ' + inttostr(VideoStreamIndex) ); writeln( 'AudioStreamIndex : ' + inttostr(AudioStreamIndex) ); end; - aCodecCtx := VideoFormatContext.streams[ AudioStreamIndex ].codec; + // FIXME: AudioStreamIndex is -1 if video has no sound -> memory access error + // Just a temporary workaround for now + aCodecCtx := nil; + if( AudioStreamIndex >= 0) then + aCodecCtx := VideoFormatContext.streams[ AudioStreamIndex ].codec; {$ifdef FFMpegAudio} // This is the audio ffmpeg audio support Jay is working on. @@ -683,11 +687,11 @@ initialization singleton_VideoFFMpeg := TVideoPlayback_ffmpeg.create(); writeln( 'UVideo_FFMpeg - Register Playback' ); - AudioManager.add( IVideoPlayback( singleton_VideoFFMpeg ) ); + AudioManager.add( singleton_VideoFFMpeg ); finalization - AudioManager.Remove( IVideoPlayback( singleton_VideoFFMpeg ) ); + AudioManager.Remove( singleton_VideoFFMpeg ); end. |