Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
7263355f
Commit
7263355f
authored
May 30, 2007
by
Laurent Aimar
Browse files
Cosmetic.
parent
79cb45a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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