access_output/srt: small udp packets
- ts muxer write one TS packet each time call sout_AccessOutWrite().
- access_output/srt doesn't combine small buffer into a larger one, so it sends a lot of small udp packets.
The issue can be solved by use a temporary buffer in srt. It can works for other media container in theory. However, I think it would be better for ts muxer to send a block chain for each sout_AccessOutWrite():
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index d40f27c7c1..ec9d0dc4fe 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -1728,6 +1728,7 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
}
/* msg_Dbg( p_mux, "real pck=%d", i_packet_count ); */
+ block_t *p_list = NULL;
for (int i = 0; i < i_packet_count; i++ )
{
block_t *p_ts = BufferChainGet( p_chain_ts );
@@ -1751,8 +1752,10 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
/* latency */
p_ts->i_dts += p_sys->i_shaping_delay * 3 / 2;
- sout_AccessOutWrite( p_mux->p_access, p_ts );
+ block_ChainAppend( &p_list, p_ts );
}
+ if ( p_list != NULL )
+ sout_AccessOutWrite( p_mux->p_access, p_list );
}
static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
And then in srt, use block_ChainGather( p_buffer ); and then send the buffer in srt_payload_size chunks.