aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-13 09:42:50 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-13 09:42:50 +0000
commitfd0388550ddbe2b817a427b6ee08be9157fff287 (patch)
tree955b382256da23a7d664cbeaaf9142446495e2b6 /src/screens
parentca61aa0c12be9240881108e72bc6c3e928924f1c (diff)
downloadusdx-fd0388550ddbe2b817a427b6ee08be9157fff287.tar.gz
usdx-fd0388550ddbe2b817a427b6ee08be9157fff287.tar.xz
usdx-fd0388550ddbe2b817a427b6ee08be9157fff287.zip
Fix for invalid song lengths
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2511 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/UScreenSong.pas8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas
index 764a0d47..6fe8d204 100644
--- a/src/screens/UScreenSong.pas
+++ b/src/screens/UScreenSong.pas
@@ -1791,6 +1791,7 @@ end;
procedure TScreenSong.StartMusicPreview();
var
Song: TSong;
+ PreviewPos: real;
begin
AudioPlayback.Close();
@@ -1809,7 +1810,12 @@ begin
begin
PreviewOpened := Interaction;
- AudioPlayback.Position := AudioPlayback.Length / 4;
+ PreviewPos := AudioPlayback.Length / 4;
+ // fix for invalid music file lengths
+ if (PreviewPos > 60.0) then
+ PreviewPos := 60.0;
+ AudioPlayback.Position := PreviewPos;
+
// set preview volume
if (Ini.PreviewFading = 0) then
begin