]> git.sesse.net Git - vlc/commitdiff
* include/vlc_block.h : Added calculation of i_length in block_ChainGather.
authorChristophe Massiot <massiot@videolan.org>
Fri, 8 Apr 2005 16:20:56 +0000 (16:20 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 8 Apr 2005 16:20:56 +0000 (16:20 +0000)
include/vlc_block.h

index cb589016e69a7e8e6744305a0600158b71f02802..bb42d3e85c1052a8282d1985ed8f3c802861ee29 100644 (file)
@@ -220,13 +220,17 @@ static int block_ChainExtract( block_t *p_list, void *p_data, int i_max )
 static inline block_t *block_ChainGather( block_t *p_list )
 {
     int     i_total = 0;
+    mtime_t i_length = 0;
     block_t *b, *g;
 
     if( p_list->p_next == NULL )
         return p_list;  /* Already gathered */
 
     for( b = p_list; b != NULL; b = b->p_next )
+    {
         i_total += b->i_buffer;
+        i_length += b->i_length;
+    }
 
     g = block_New( p_list->p_manager, i_total );
     block_ChainExtract( p_list, g->p_buffer, g->i_buffer );
@@ -234,6 +238,7 @@ static inline block_t *block_ChainGather( block_t *p_list )
     g->i_flags = p_list->i_flags;
     g->i_pts   = p_list->i_pts;
     g->i_dts   = p_list->i_dts;
+    g->i_length = i_length;
 
     /* free p_list */
     block_ChainRelease( p_list );