diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-18 03:51:24 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-12-18 03:51:24 +0000 |
commit | c7e01792aaf8f16bb17d7254d93157d617271391 (patch) | |
tree | f07140030b1eb35120576f5ab41ecebbb6e7843b /Game/Code/Classes | |
parent | 19903a5497d2a4468280cab56b0cac71207e3c03 (diff) | |
download | usdx-c7e01792aaf8f16bb17d7254d93157d617271391.tar.gz usdx-c7e01792aaf8f16bb17d7254d93157d617271391.tar.xz usdx-c7e01792aaf8f16bb17d7254d93157d617271391.zip |
fixed crash on song play, if the AudioInterface reports the song
as 0 length.
fixed ffmpeg bug with song length.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@722 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes')
-rw-r--r-- | Game/Code/Classes/UAudio_FFMpeg.pas | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/Game/Code/Classes/UAudio_FFMpeg.pas b/Game/Code/Classes/UAudio_FFMpeg.pas index 8cef934b..9a242cd9 100644 --- a/Game/Code/Classes/UAudio_FFMpeg.pas +++ b/Game/Code/Classes/UAudio_FFMpeg.pas @@ -375,37 +375,33 @@ function TAudio_FFMpeg.Length: real; var bytes: integer; begin - Result := MusicStream.pFormatCtx^.duration / AV_TIME_BASE; + Result := 0; + // Todo : why is Music stream always nil !? + + if assigned( MusicStream ) then + begin + //writeln( 'MusicStream : ' + inttostr( integer( assigned( MusicStream ))) ); + //writeln( 'MusicStream.pFormatCtx : ' + inttostr( integer( assigned( MusicStream.pFormatCtx ))) ); + //writeln( 'MusicStream.pFormatCtx^.duration : ' + inttostr( integer( MusicStream.pFormatCtx^.duration )) ); + + Result := MusicStream.pFormatCtx^.duration / AV_TIME_BASE; + end; end; function TAudio_FFMpeg.getPosition: real; -var - bytes: integer; begin Result := 0; - -(* - bytes := BASS_ChannelGetPosition(BASS); - Result := BASS_ChannelBytes2Seconds(BASS, bytes); -*) end; function TAudio_FFMpeg.Finished: boolean; begin Result := false; - -(* - if BASS_ChannelIsActive(BASS) = BASS_ACTIVE_STOPPED then - begin - Result := true; - end; -*) end; procedure TAudio_FFMpeg.PlayStart; begin if StartSoundStream <> nil then - StartSoundStream.Play(); + StartSoundStream.Play(); end; procedure TAudio_FFMpeg.PlayBack; |