[vlc-commits] block_t: repack
Rémi Denis-Courmont
git at videolan.org
Mon Aug 29 17:41:18 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 29 17:53:18 2011 +0300| [2c2b4687b00fcb5a29bfdd0802cfa97cd22310f5] | committer: Rémi Denis-Courmont
block_t: repack
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c2b4687b00fcb5a29bfdd0802cfa97cd22310f5
---
include/vlc_block.h | 13 ++++++-------
src/misc/block.c | 8 ++++----
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/include/vlc_block.h b/include/vlc_block.h
index 60092e3..746310d 100644
--- a/include/vlc_block.h
+++ b/include/vlc_block.h
@@ -103,17 +103,16 @@ struct block_t
{
block_t *p_next;
+ uint8_t *p_buffer;
+ size_t i_buffer;
+
uint32_t i_flags;
+ unsigned i_nb_samples; /* Used for audio */
mtime_t i_pts;
mtime_t i_dts;
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. */
block_free_t pf_release;
};
@@ -147,11 +146,11 @@ static inline block_t *block_Duplicate( block_t *p_block )
if( p_dup == 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_pts = p_block->i_pts;
- p_dup->i_flags = p_block->i_flags;
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 );
return p_dup;
diff --git a/src/misc/block.c b/src/misc/block.c
index 9732134..36fda91 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -60,13 +60,13 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
{
/* Fill all fields to their default */
b->p_next = NULL;
+ b->p_buffer = buf;
+ b->i_buffer = size;
b->i_flags = 0;
+ b->i_nb_samples = 0;
b->i_pts =
b->i_dts = VLC_TS_INVALID;
b->i_length = 0;
- b->i_nb_samples = 0;
- b->p_buffer = buf;
- b->i_buffer = size;
#ifndef NDEBUG
b->pf_release = BlockNoRelease;
#endif
@@ -80,11 +80,11 @@ static void BlockRelease( block_t *p_block )
static void BlockMetaCopy( block_t *restrict out, const block_t *in )
{
out->p_next = in->p_next;
+ out->i_nb_samples = in->i_nb_samples;
out->i_dts = in->i_dts;
out->i_pts = in->i_pts;
out->i_flags = in->i_flags;
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) */
More information about the vlc-commits
mailing list