Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
919002be
Commit
919002be
authored
Aug 26, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added small block_ChainProperties helper.
parent
92a4a5b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
include/vlc_block.h
include/vlc_block.h
+25
-6
No files found.
include/vlc_block.h
View file @
919002be
...
...
@@ -217,20 +217,39 @@ static size_t block_ChainExtract( block_t *p_list, void *p_data, size_t i_max )
return
i_total
;
}
static
inline
void
block_ChainProperties
(
block_t
*
p_list
,
int
*
pi_count
,
size_t
*
pi_size
,
mtime_t
*
pi_length
)
{
size_t
i_size
=
0
;
mtime_t
i_length
=
0
;
int
i_count
;
while
(
p_list
)
{
i_size
+=
p_list
->
i_buffer
;
i_length
+=
p_list
->
i_length
;
i_count
++
;
p_list
=
p_list
->
p_next
;
}
if
(
pi_size
)
*
pi_size
=
i_size
;
if
(
pi_length
)
*
pi_length
=
i_length
;
if
(
pi_count
)
*
pi_count
=
i_count
;
}
static
inline
block_t
*
block_ChainGather
(
block_t
*
p_list
)
{
size_t
i_total
=
0
;
mtime_t
i_length
=
0
;
block_t
*
b
,
*
g
;
block_t
*
g
;
if
(
p_list
->
p_next
==
NULL
)
return
p_list
;
/* Already gathered */
for
(
b
=
p_list
;
b
!=
NULL
;
b
=
b
->
p_next
)
{
i_total
+=
b
->
i_buffer
;
i_length
+=
b
->
i_length
;
}
block_ChainProperties
(
p_list
,
NULL
,
&
i_total
,
&
i_length
);
g
=
block_Alloc
(
i_total
);
block_ChainExtract
(
p_list
,
g
->
p_buffer
,
g
->
i_buffer
);
...
...
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