Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
cf1fd2b0
Commit
cf1fd2b0
authored
Jul 22, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/flac: return early from flac_find_float_comment()
When one metadata check fails, return quickly. This removes 2 levels of indent.
parent
8e2d9879
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
_flac_common.c
src/decoder/_flac_common.c
+22
-21
No files found.
src/decoder/_flac_common.c
View file @
cf1fd2b0
...
...
@@ -44,27 +44,28 @@ static bool
flac_find_float_comment
(
const
FLAC__StreamMetadata
*
block
,
const
char
*
cmnt
,
float
*
fl
)
{
int
offset
=
FLAC__metadata_object_vorbiscomment_find_entry_from
(
block
,
0
,
cmnt
);
if
(
offset
>=
0
)
{
size_t
pos
=
strlen
(
cmnt
)
+
1
;
/* 1 is for '=' */
int
len
=
block
->
data
.
vorbis_comment
.
comments
[
offset
].
length
-
pos
;
if
(
len
>
0
)
{
unsigned
char
tmp
;
unsigned
char
*
p
=
&
(
block
->
data
.
vorbis_comment
.
comments
[
offset
].
entry
[
pos
]);
tmp
=
p
[
len
];
p
[
len
]
=
'\0'
;
*
fl
=
(
float
)
atof
((
char
*
)
p
);
p
[
len
]
=
tmp
;
return
true
;
}
}
return
false
;
int
offset
;
size_t
pos
;
int
len
;
unsigned
char
tmp
,
*
p
;
offset
=
FLAC__metadata_object_vorbiscomment_find_entry_from
(
block
,
0
,
cmnt
);
if
(
offset
<
0
)
return
false
;
pos
=
strlen
(
cmnt
)
+
1
;
/* 1 is for '=' */
len
=
block
->
data
.
vorbis_comment
.
comments
[
offset
].
length
-
pos
;
if
(
len
<=
0
)
return
false
;
p
=
&
block
->
data
.
vorbis_comment
.
comments
[
offset
].
entry
[
pos
];
tmp
=
p
[
len
];
p
[
len
]
=
'\0'
;
*
fl
=
(
float
)
atof
((
char
*
)
p
);
p
[
len
]
=
tmp
;
return
true
;
}
static
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment