Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timothy B. Terriberry
Opusfile
Commits
42aa4901
Commit
42aa4901
authored
Nov 19, 2012
by
Timothy B. Terriberry
Browse files
Small clarity improvements to op_get_next_page().
The assert might also be helpful for static analysis.
parent
f2e27e4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opusfile.c
View file @
42aa4901
...
...
@@ -182,9 +182,8 @@ static opus_int64 op_position(OggOpusFile *_of){
OP_BADLINK: We hit end-of-file before reaching _boundary.*/
static
opus_int64
op_get_next_page
(
OggOpusFile
*
_of
,
ogg_page
*
_og
,
opus_int64
_boundary
){
for
(;;
){
while
(
_boundary
<=
0
||
_of
->
offset
<
_boundary
){
int
more
;
if
(
_boundary
>
0
&&
_of
->
offset
>=
_boundary
)
return
OP_FALSE
;
more
=
ogg_sync_pageseek
(
&
_of
->
oy
,
_og
);
/*Skipped (-more) bytes.*/
if
(
OP_UNLIKELY
(
more
<
0
))
_of
->
offset
-=
more
;
...
...
@@ -211,14 +210,16 @@ static opus_int64 op_get_next_page(OggOpusFile *_of,ogg_page *_og,
}
else
{
/*Got a page.
Return the
offset at the page beginning,
advance the internal offset
past the
page end.*/
Return the
page start offset and
advance the internal offset
past the
page end.*/
opus_int64
page_offset
;
page_offset
=
_of
->
offset
;
_of
->
offset
+=
more
;
OP_ASSERT
(
page_offset
>=
0
);
return
page_offset
;
}
}
return
OP_FALSE
;
}
static
int
op_add_serialno
(
ogg_page
*
_og
,
...
...
Write
Preview
Supports
Markdown
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