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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
twi
SRB2
Commits
21c6836f
Commit
21c6836f
authored
6 years ago
by
SteelT
Browse files
Options
Downloads
Patches
Plain Diff
Some few comments
parent
e1128562
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdl/mixer_sound.c
+10
-4
10 additions, 4 deletions
src/sdl/mixer_sound.c
with
10 additions
and
4 deletions
src/sdl/mixer_sound.c
+
10
−
4
View file @
21c6836f
...
@@ -1116,6 +1116,12 @@ boolean I_LoadSong(char *data, size_t len)
...
@@ -1116,6 +1116,12 @@ boolean I_LoadSong(char *data, size_t len)
size_t
probesize
;
size_t
probesize
;
int
result
;
int
result
;
/*
If the size of the data to be checked is bigger than the recommended size (> 2048)
Let's just set the probe size to the recommended size
Otherwise let's give it the full data size
*/
if
(
len
>
openmpt_probe_file_header_get_recommended_size
())
if
(
len
>
openmpt_probe_file_header_get_recommended_size
())
probesize
=
openmpt_probe_file_header_get_recommended_size
();
probesize
=
openmpt_probe_file_header_get_recommended_size
();
else
else
...
@@ -1126,7 +1132,7 @@ boolean I_LoadSong(char *data, size_t len)
...
@@ -1126,7 +1132,7 @@ boolean I_LoadSong(char *data, size_t len)
if
(
result
==
OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS
)
// We only cared if it succeeded, continue on if not.
if
(
result
==
OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS
)
// We only cared if it succeeded, continue on if not.
{
{
openmpt_mhandle
=
openmpt_module_create_from_memory2
(
data
,
len
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
openmpt_mhandle
=
openmpt_module_create_from_memory2
(
data
,
len
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
openmpt_mhandle
)
if
(
!
openmpt_mhandle
)
// Failed to create module handle? Show error and return!
{
{
mod_err
=
openmpt_module_error_get_last
(
openmpt_mhandle
);
mod_err
=
openmpt_module_error_get_last
(
openmpt_mhandle
);
mod_err_str
=
openmpt_error_string
(
mod_err
);
mod_err_str
=
openmpt_error_string
(
mod_err
);
...
@@ -1134,10 +1140,11 @@ boolean I_LoadSong(char *data, size_t len)
...
@@ -1134,10 +1140,11 @@ boolean I_LoadSong(char *data, size_t len)
return
false
;
return
false
;
}
}
else
else
return
true
;
return
true
;
// All good and we're ready for music playback!
}
}
#endif
#endif
// Let's see if Mixer is able to load this.
rw
=
SDL_RWFromMem
(
data
,
len
);
rw
=
SDL_RWFromMem
(
data
,
len
);
if
(
rw
!=
NULL
)
if
(
rw
!=
NULL
)
{
{
...
@@ -1149,7 +1156,6 @@ boolean I_LoadSong(char *data, size_t len)
...
@@ -1149,7 +1156,6 @@ boolean I_LoadSong(char *data, size_t len)
return
false
;
return
false
;
}
}
// Find the OGG loop point.
// Find the OGG loop point.
loop_point
=
0
.
0
f
;
loop_point
=
0
.
0
f
;
song_length
=
0
.
0
f
;
song_length
=
0
.
0
f
;
...
...
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