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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
DecoderBuffer.cxx
src/decoder/DecoderBuffer.cxx
+8
-17
No files found.
src/decoder/DecoderBuffer.cxx
View file @
543a58bb
...
@@ -165,23 +165,14 @@ decoder_buffer_consume(DecoderBuffer *buffer, size_t nbytes)
...
@@ -165,23 +165,14 @@ decoder_buffer_consume(DecoderBuffer *buffer, size_t nbytes)
bool
bool
decoder_buffer_skip
(
DecoderBuffer
*
buffer
,
size_t
nbytes
)
decoder_buffer_skip
(
DecoderBuffer
*
buffer
,
size_t
nbytes
)
{
{
bool
success
;
const
size_t
available
=
decoder_buffer_available
(
buffer
);
if
(
available
>=
nbytes
)
{
decoder_buffer_consume
(
buffer
,
nbytes
);
return
true
;
}
/* this could probably be optimized by seeking */
decoder_buffer_clear
(
buffer
);
nbytes
-=
available
;
while
(
true
)
{
return
decoder_skip
(
buffer
->
decoder
,
*
buffer
->
is
,
nbytes
);
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
)
return
true
;
}
success
=
decoder_buffer_fill
(
buffer
);
if
(
!
success
)
return
false
;
}
}
}
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