Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7263355f
Commit
7263355f
authored
May 30, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetic.
parent
79cb45a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
src/misc/block.c
src/misc/block.c
+21
-11
No files found.
src/misc/block.c
View file @
7263355f
...
...
@@ -54,7 +54,8 @@ block_t *__block_New( vlc_object_t *p_obj, int i_size )
block_t
*
p_block
=
malloc
(
sizeof
(
block_t
)
+
sizeof
(
block_sys_t
)
+
i_alloc
);
if
(
p_block
==
NULL
)
return
NULL
;
if
(
p_block
==
NULL
)
return
NULL
;
/* Fill opaque data */
p_sys
=
(
block_sys_t
*
)(
(
uint8_t
*
)
p_block
+
sizeof
(
block_t
)
);
...
...
@@ -93,13 +94,19 @@ block_t *block_Realloc( block_t *p_block, int i_prebody, int i_body )
* TODO if used one day, them implement it in a smarter way */
block_t
*
p_dup
=
block_Duplicate
(
p_block
);
block_Release
(
p_block
);
if
(
!
p_dup
)
return
NULL
;
p_block
=
p_dup
;
}
i_buffer_size
=
i_prebody
+
i_body
;
if
(
i_body
<
0
||
i_buffer_size
<=
0
)
return
NULL
;
if
(
i_body
<
0
||
i_buffer_size
<=
0
)
{
block_Release
(
p_block
);
return
NULL
;
}
if
(
p_block
->
p_buffer
-
i_prebody
>
p_block
->
p_sys
->
p_allocated_buffer
&&
p_block
->
p_buffer
-
i_prebody
<
p_block
->
p_sys
->
p_allocated_buffer
+
...
...
@@ -120,15 +127,18 @@ block_t *block_Realloc( block_t *p_block, int i_prebody, int i_body )
{
block_t
*
p_rea
=
block_New
(
p_block
->
p_manager
,
i_buffer_size
);
p_rea
->
i_dts
=
p_block
->
i_dts
;
p_rea
->
i_pts
=
p_block
->
i_pts
;
p_rea
->
i_flags
=
p_block
->
i_flags
;
p_rea
->
i_length
=
p_block
->
i_length
;
p_rea
->
i_rate
=
p_block
->
i_rate
;
p_rea
->
i_samples
=
p_block
->
i_samples
;
memcpy
(
p_rea
->
p_buffer
+
i_prebody
,
p_block
->
p_buffer
,
__MIN
(
p_block
->
i_buffer
,
p_rea
->
i_buffer
-
i_prebody
)
);
if
(
p_rea
)
{
p_rea
->
i_dts
=
p_block
->
i_dts
;
p_rea
->
i_pts
=
p_block
->
i_pts
;
p_rea
->
i_flags
=
p_block
->
i_flags
;
p_rea
->
i_length
=
p_block
->
i_length
;
p_rea
->
i_rate
=
p_block
->
i_rate
;
p_rea
->
i_samples
=
p_block
->
i_samples
;
memcpy
(
p_rea
->
p_buffer
+
i_prebody
,
p_block
->
p_buffer
,
__MIN
(
p_block
->
i_buffer
,
p_rea
->
i_buffer
-
i_prebody
)
);
}
block_Release
(
p_block
);
...
...
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