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
543a58bb
Commit
543a58bb
authored
Jul 12, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderBuffer: implement _skip() using decoder_skip()
parent
b2b95cad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
16 deletions
+7
-16
DecoderBuffer.cxx
src/decoder/DecoderBuffer.cxx
+7
-16
No files found.
src/decoder/DecoderBuffer.cxx
View file @
543a58bb
...
...
@@ -165,23 +165,14 @@ decoder_buffer_consume(DecoderBuffer *buffer, size_t nbytes)
bool
decoder_buffer_skip
(
DecoderBuffer
*
buffer
,
size_t
nbytes
)
{
bool
success
;
/* this could probably be optimized by seeking */
while
(
true
)
{
auto
data
=
decoder_buffer_read
(
buffer
);
if
(
!
data
.
IsEmpty
())
{
if
(
data
.
size
>
nbytes
)
data
.
size
=
nbytes
;
decoder_buffer_consume
(
buffer
,
data
.
size
);
nbytes
-=
data
.
size
;
if
(
nbytes
==
0
)
const
size_t
available
=
decoder_buffer_available
(
buffer
);
if
(
available
>=
nbytes
)
{
decoder_buffer_consume
(
buffer
,
nbytes
);
return
true
;
}
success
=
decoder_buffer_fill
(
buffer
);
if
(
!
success
)
return
false
;
}
decoder_buffer_clear
(
buffer
);
nbytes
-=
available
;
return
decoder_skip
(
buffer
->
decoder
,
*
buffer
->
is
,
nbytes
);
}
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