diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-13 09:42:50 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-13 09:42:50 +0000 |
commit | fd0388550ddbe2b817a427b6ee08be9157fff287 (patch) | |
tree | 955b382256da23a7d664cbeaaf9142446495e2b6 | |
parent | ca61aa0c12be9240881108e72bc6c3e928924f1c (diff) | |
download | usdx-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
-rw-r--r-- | src/media/UAudioDecoder_FFmpeg.pas | 2 | ||||
-rw-r--r-- | src/screens/UScreenSong.pas | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas index 2badb84d..c64d79c2 100644 --- a/src/media/UAudioDecoder_FFmpeg.pas +++ b/src/media/UAudioDecoder_FFmpeg.pas @@ -728,7 +728,7 @@ begin begin // seeking failed fErrorState := true; - Log.LogStatus('Seek Error in "'+fFormatCtx^.filename+'"', 'UAudioDecoder_FFmpeg'); + Log.LogError('Seek Error in "'+fFormatCtx^.filename+'"', 'UAudioDecoder_FFmpeg'); end else begin 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 |