Commit 2c2b4687 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

block_t: repack

parent 66421873
...@@ -103,17 +103,16 @@ struct block_t ...@@ -103,17 +103,16 @@ struct block_t
{ {
block_t *p_next; block_t *p_next;
uint8_t *p_buffer;
size_t i_buffer;
uint32_t i_flags; uint32_t i_flags;
unsigned i_nb_samples; /* Used for audio */
mtime_t i_pts; mtime_t i_pts;
mtime_t i_dts; mtime_t i_dts;
mtime_t i_length; mtime_t i_length;
unsigned i_nb_samples; /* Used for audio */
size_t i_buffer;
uint8_t *p_buffer;
/* Rudimentary support for overloading block (de)allocation. */ /* Rudimentary support for overloading block (de)allocation. */
block_free_t pf_release; block_free_t pf_release;
}; };
...@@ -147,11 +146,11 @@ static inline block_t *block_Duplicate( block_t *p_block ) ...@@ -147,11 +146,11 @@ static inline block_t *block_Duplicate( block_t *p_block )
if( p_dup == NULL ) if( p_dup == NULL )
return NULL; return NULL;
p_dup->i_flags = p_block->i_flags;
p_dup->i_nb_samples = p_block->i_nb_samples;
p_dup->i_dts = p_block->i_dts; p_dup->i_dts = p_block->i_dts;
p_dup->i_pts = p_block->i_pts; 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_length = p_block->i_length;
p_dup->i_nb_samples = p_block->i_nb_samples;
memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer ); memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer );
return p_dup; return p_dup;
......
...@@ -60,13 +60,13 @@ void block_Init( block_t *restrict b, void *buf, size_t size ) ...@@ -60,13 +60,13 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
{ {
/* Fill all fields to their default */ /* Fill all fields to their default */
b->p_next = NULL; b->p_next = NULL;
b->p_buffer = buf;
b->i_buffer = size;
b->i_flags = 0; b->i_flags = 0;
b->i_nb_samples = 0;
b->i_pts = b->i_pts =
b->i_dts = VLC_TS_INVALID; b->i_dts = VLC_TS_INVALID;
b->i_length = 0; b->i_length = 0;
b->i_nb_samples = 0;
b->p_buffer = buf;
b->i_buffer = size;
#ifndef NDEBUG #ifndef NDEBUG
b->pf_release = BlockNoRelease; b->pf_release = BlockNoRelease;
#endif #endif
...@@ -80,11 +80,11 @@ static void BlockRelease( block_t *p_block ) ...@@ -80,11 +80,11 @@ static void BlockRelease( block_t *p_block )
static void BlockMetaCopy( block_t *restrict out, const block_t *in ) static void BlockMetaCopy( block_t *restrict out, const block_t *in )
{ {
out->p_next = in->p_next; out->p_next = in->p_next;
out->i_nb_samples = in->i_nb_samples;
out->i_dts = in->i_dts; out->i_dts = in->i_dts;
out->i_pts = in->i_pts; out->i_pts = in->i_pts;
out->i_flags = in->i_flags; out->i_flags = in->i_flags;
out->i_length = in->i_length; out->i_length = in->i_length;
out->i_nb_samples = in->i_nb_samples;
} }
/* Memory alignment (must be a multiple of sizeof(void*) and a power of two) */ /* Memory alignment (must be a multiple of sizeof(void*) and a power of two) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment