[vlc-devel] [PATCH] access: dvb: Realloc block to actually used size.

Julian Scheel julian at jusst.de
Fri Sep 20 11:48:48 CEST 2013

For low bandwidth streams (seen with DVB-C Radio) it can happen that the blocks
are not fully used, because less than 20 TS packets are available from the
demuxer at the given time. This leads to a quite high memory usage due to empty
buffer memory lying around. Avoid this by reallocating the buffer blocks to the
actually used size, like it is done in other access modules (ie udp) already.

Signed-off-by: Julian Scheel <julian at jusst.de>
 modules/access/dtv/access.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 13def2d..9b6674e 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -521,7 +521,7 @@ static block_t *Read (access_t *access)
     block->i_buffer = val;
-    return block;
+    return block_Realloc (block, 0, val);
 static int Control (access_t *access, int query, va_list args)

More information about the vlc-devel mailing list