long delay because we only receive PAT at the start), but we increase each time we read
data until 20. This decrease the load (more than 50% for me) while kepping low start up delay.
static block_t *Block( access_t * );
static int Control( access_t *, int, va_list );
static block_t *Block( access_t * );
static int Control( access_t *, int, va_list );
+#define DVB_READ_ONCE 20
+#define DVB_READ_ONCE_START 2
#define TS_PACKET_SIZE 188
static void FilterUnset( access_t *, int i_max );
#define TS_PACKET_SIZE 188
static void FilterUnset( access_t *, int i_max );
+ if( p_sys->b_budget_mode )
+ p_sys->i_read_once = DVB_READ_ONCE;
+ else
+ p_sys->i_read_once = DVB_READ_ONCE_START;
+
- p_block = block_New( p_access, DVB_READ_ONCE * TS_PACKET_SIZE );
+ p_block = block_New( p_access, p_sys->i_read_once * TS_PACKET_SIZE );
if( ( p_block->i_buffer = read( p_sys->i_handle, p_block->p_buffer,
if( ( p_block->i_buffer = read( p_sys->i_handle, p_block->p_buffer,
- DVB_READ_ONCE * TS_PACKET_SIZE ) ) <= 0 )
+ p_sys->i_read_once*TS_PACKET_SIZE ) ) <= 0 )
{
msg_Err( p_access, "read failed (%s)", strerror(errno) );
block_Release( p_block );
return NULL;
}
{
msg_Err( p_access, "read failed (%s)", strerror(errno) );
block_Release( p_block );
return NULL;
}
+ if( p_sys->i_read_once < DVB_READ_ONCE )
+ p_sys->i_read_once++;
+
}
p_sys->p_demux_handles[i].i_type = i_type;
p_sys->p_demux_handles[i].i_pid = i_pid;
}
p_sys->p_demux_handles[i].i_type = i_type;
p_sys->p_demux_handles[i].i_pid = i_pid;
+
+ if( p_sys->i_read_once < DVB_READ_ONCE )
+ p_sys->i_read_once++;
}
static void FilterUnset( access_t *p_access, int i_max )
}
static void FilterUnset( access_t *p_access, int i_max )
en50221_session_t p_sessions[MAX_SESSIONS];
mtime_t i_ca_timeout, i_ca_next_event, i_frontend_timeout;
dvbpsi_pmt_t *pp_selected_programs[MAX_PROGRAMS];
en50221_session_t p_sessions[MAX_SESSIONS];
mtime_t i_ca_timeout, i_ca_next_event, i_frontend_timeout;
dvbpsi_pmt_t *pp_selected_programs[MAX_PROGRAMS];
+
+ /* */
+ int i_read_once;