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
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
3e5b0c45
Commit
3e5b0c45
authored
5 years ago
by
Marco Z
Browse files
Options
Downloads
Patches
Plain Diff
Remove MP3 widechar tag searching
1. It's slow, 2. It's incorrect
parent
ab0fe6b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!486
Fix music load lag by reverting tag changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdl/mixer_sound.c
+0
-56
0 additions, 56 deletions
src/sdl/mixer_sound.c
with
0 additions
and
56 deletions
src/sdl/mixer_sound.c
+
0
−
56
View file @
3e5b0c45
...
...
@@ -908,15 +908,6 @@ boolean I_LoadSong(char *data, size_t len)
const
size_t
key3len
=
strlen
(
key3
);
const
size_t
key4len
=
strlen
(
key4
);
// for mp3 wide chars
const
char
*
key1w
=
"L
\0
O
\0
O
\0
P
\0
"
;
const
char
*
key2w
=
"P
\0
O
\0
I
\0
N
\0
T
\0\0\0\xFF\xFE
"
;
const
char
*
key3w
=
"M
\0
S
\0\0\0\xFF\xFE
"
;
const
char
*
key4w
=
"L
\0
E
\0
N
\0
G
\0
T
\0
H
\0
M
\0
S
\0\0\0\xFF\xFE
"
;
const
char
*
wterm
=
"
\0\0
"
;
char
wval
[
10
];
size_t
wstart
,
wp
;
char
*
p
=
data
;
SDL_RWops
*
rw
;
...
...
@@ -1067,53 +1058,6 @@ boolean I_LoadSong(char *data, size_t len)
p
+=
key4len
;
// skip LENGTHMS
song_length
=
(
float
)(
atoi
(
p
)
/
1000
.
0L
);
}
// below: search MP3 or other tags that use wide char encoding
else
if
(
fpclassify
(
loop_point
)
==
FP_ZERO
&&
!
memcmp
(
p
,
key1w
,
key1len
*
2
))
// LOOP wide char
{
p
+=
key1len
*
2
;
if
(
!
memcmp
(
p
,
key2w
,
(
key2len
+
1
)
*
2
))
// POINT= wide char
{
p
+=
(
key2len
+
1
)
*
2
;
wstart
=
(
size_t
)
p
;
wp
=
0
;
while
(
wp
<
9
&&
memcmp
(
p
,
wterm
,
2
))
{
wval
[
wp
]
=
*
p
;
p
+=
2
;
wp
=
((
size_t
)(
p
-
wstart
))
/
2
;
}
wval
[
min
(
wp
,
9
)]
=
0
;
loop_point
=
(
float
)((
44
.
1L
+
atoi
(
wval
)
/
44100
.
0L
));
}
else
if
(
!
memcmp
(
p
,
key3w
,
(
key3len
+
1
)
*
2
))
// MS= wide char
{
p
+=
(
key3len
+
1
)
*
2
;
wstart
=
(
size_t
)
p
;
wp
=
0
;
while
(
wp
<
9
&&
memcmp
(
p
,
wterm
,
2
))
{
wval
[
wp
]
=
*
p
;
p
+=
2
;
wp
=
((
size_t
)(
p
-
wstart
))
/
2
;
}
wval
[
min
(
wp
,
9
)]
=
0
;
loop_point
=
(
float
)(
atoi
(
wval
)
/
1000
.
0L
);
}
}
else
if
(
fpclassify
(
song_length
)
==
FP_ZERO
&&
!
memcmp
(
p
,
key4w
,
(
key4len
+
1
)
*
2
))
// LENGTHMS= wide char
{
p
+=
(
key4len
+
1
)
*
2
;
wstart
=
(
size_t
)
p
;
wp
=
0
;
while
(
wp
<
9
&&
memcmp
(
p
,
wterm
,
2
))
{
wval
[
wp
]
=
*
p
;
p
+=
2
;
wp
=
((
size_t
)(
p
-
wstart
))
/
2
;
}
wval
[
min
(
wp
,
9
)]
=
0
;
song_length
=
(
float
)(
atoi
(
wval
)
/
1000
.
0L
);
}
if
(
fpclassify
(
loop_point
)
!=
FP_ZERO
&&
fpclassify
(
song_length
)
!=
FP_ZERO
&&
song_length
>
loop_point
)
// Got what we needed
// the last case is a sanity check, in case the wide char searches were false matches.
...
...
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