Skip to content

Commit

Permalink
* include/vlc_block.h: block_Duplicate() needs to duplicate all the f…
Browse files Browse the repository at this point in the history
…ields of block_t.
  • Loading branch information
Gildas Bazin committed Sep 13, 2004
1 parent 7dd83af commit 864829a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions include/vlc_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ static inline block_t *block_Duplicate( block_t *p_block )
{
block_t *p_dup = block_New( p_block->p_manager, p_block->i_buffer );

p_dup->i_dts = p_block->i_dts;
p_dup->i_pts = p_block->i_pts;
p_dup->i_flags = p_block->i_flags;
p_dup->i_length = p_block->i_length;
p_dup->i_rate = p_block->i_rate;
p_dup->i_samples = p_block->i_samples;

if( p_dup && p_block->i_buffer > 0 )
memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer );

Expand Down
11 changes: 6 additions & 5 deletions src/misc/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ 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_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 ) );
Expand Down

0 comments on commit 864829a

Please sign in to comment.