Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SteelT
SRB2
Commits
963d2f5d
Commit
963d2f5d
authored
5 years ago
by
Alam Ed Arias
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into next
parents
6eaf7625
66f84efd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdl/mixer_sound.c
+5
-5
5 additions, 5 deletions
src/sdl/mixer_sound.c
with
5 additions
and
5 deletions
src/sdl/mixer_sound.c
+
5
−
5
View file @
963d2f5d
...
...
@@ -98,8 +98,8 @@ static INT32 current_track;
static
void
var_cleanup
(
void
)
{
loop_point
=
song_length
=
\
music_bytes
=
fading_source
=
fading_target
=
\
song_length
=
loop_point
=
0
.
0
f
;
music_bytes
=
fading_source
=
fading_target
=
\
fading_timer
=
fading_duration
=
0
;
songpaused
=
is_looping
=
\
...
...
@@ -569,7 +569,7 @@ static void music_loop(void)
{
Mix_PlayMusic
(
music
,
0
);
Mix_SetMusicPosition
(
loop_point
);
music_bytes
=
loop_point
*
44100
.
0L
*
4
;
//assume 44.1khz, 4-byte length (see I_GetSongPosition)
music_bytes
=
(
UINT32
)(
loop_point
*
44100
.
0L
*
4
)
;
//assume 44.1khz, 4-byte length (see I_GetSongPosition)
}
else
I_StopSong
();
...
...
@@ -843,7 +843,7 @@ boolean I_SetSongPosition(UINT32 position)
Mix_RewindMusic
();
// needed for mp3
if
(
Mix_SetMusicPosition
((
float
)(
position
/
1000
.
0L
))
==
0
)
music_bytes
=
position
/
1000
.
0L
*
44100
.
0L
*
4
;
//assume 44.1khz, 4-byte length (see I_GetSongPosition)
music_bytes
=
(
UINT32
)(
position
/
1000
.
0L
*
44100
.
0L
*
4
)
;
//assume 44.1khz, 4-byte length (see I_GetSongPosition)
else
// NOTE: This block fires on incorrect song format,
// NOT if position input is greater than song length.
...
...
@@ -887,7 +887,7 @@ UINT32 I_GetSongPosition(void)
if
(
!
music
||
I_SongType
()
==
MU_MID
)
return
0
;
else
return
music_bytes
/
44100
.
0L
*
1000
.
0L
/
4
;
//assume 44.1khz
return
(
UINT32
)(
music_bytes
/
44100
.
0L
*
1000
.
0L
/
4
)
;
//assume 44.1khz
// 4 = byte length for 16-bit samples (AUDIO_S16SYS), stereo (2-channel)
// This is hardcoded in I_StartupSound. Other formats for factor:
// 8M: 1 | 8S: 2 | 16M: 2 | 16S: 4
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment