Commit cd56127f authored by Marian Ďurkovič's avatar Marian Ďurkovič Committed by Christophe Massiot

* demux.c: Make sure we reset CAM if it outputs garbage (invalid PES headers)

parent a83c133e
...@@ -255,12 +255,13 @@ static void demux_Handle( block_t *p_ts ) ...@@ -255,12 +255,13 @@ static void demux_Handle( block_t *p_ts )
output_t *p_output = p_pids[i_pid].pp_outputs[i]; output_t *p_output = p_pids[i_pid].pp_outputs[i];
if ( p_output != NULL ) if ( p_output != NULL )
{ {
if ( i_ca_handle && (p_output->i_config & OUTPUT_WATCH) ) if ( i_ca_handle && (p_output->i_config & OUTPUT_WATCH) &&
block_UnitStart( p_ts ) )
{ {
uint8_t *p_payload; uint8_t *p_payload;
if ( block_GetScrambling( p_ts ) || if ( block_GetScrambling( p_ts ) ||
( block_UnitStart( p_ts ) && p_pids[i_pid].b_pes ( p_pids[i_pid].b_pes
&& (p_payload = block_GetPayload( p_ts )) != NULL && (p_payload = block_GetPayload( p_ts )) != NULL
&& p_payload + 3 < p_ts->p_ts + TS_SIZE && p_payload + 3 < p_ts->p_ts + TS_SIZE
&& (p_payload[0] != 0 || p_payload[1] != 0 && (p_payload[0] != 0 || p_payload[1] != 0
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define EMPTY_PID 8192 #define EMPTY_PID 8192
#define PADDING_PID 8191 #define PADDING_PID 8191
#define WATCHDOG_WAIT 10000000LL #define WATCHDOG_WAIT 10000000LL
#define MAX_ERRORS 100000 #define MAX_ERRORS 1000
#define DEFAULT_VERBOSITY 3 #define DEFAULT_VERBOSITY 3
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment