c->p_data[c->i_data++] = cc[1];
}
-static inline void cc_Extract( cc_data_t *c, const uint8_t *p_src, int i_src )
+static inline void cc_Extract( cc_data_t *c, bool b_top_field_first, const uint8_t *p_src, int i_src )
{
static const uint8_t p_cc_ga94[4] = { 0x47, 0x41, 0x39, 0x34 };
static const uint8_t p_cc_dvd[4] = { 0x43, 0x43, 0x01, 0xf8 };
static const uint8_t p_cc_replaytv5a[2] = { 0x99, 0x02 };
static const uint8_t p_cc_replaytv5b[2] = { 0xaa, 0x02 };
static const uint8_t p_cc_scte20[2] = { 0x03, 0x81 };
+ static const uint8_t p_cc_scte20_old[2] = { 0x03, 0x01 };
//static const uint8_t p_afd_start[4] = { 0x44, 0x54, 0x47, 0x31 };
if( i_src < 4 )
}
c->b_reorder = false;
}
- else if( !memcmp( p_cc_scte20, p_src, 2 ) && i_src > 2 )
+ else if( ( !memcmp( p_cc_scte20, p_src, 2 ) ||
+ !memcmp( p_cc_scte20_old, p_src, 2 ) ) && i_src > 2 )
{
/* SCTE-20 CC */
bs_t s;
}
bs_skip( &s, 1 );
- if( i_field_idx != 1 && i_field_idx != 2 )
+ if( i_field_idx == 0 )
continue;
if( c->i_data + 2*3 > CC_MAX_DATA_SIZE )
continue;
- const int i_field = i_field_idx - 1;
+ /* 1,2,3 -> 0,1,0. I.E. repeated field 3 is merged with field 1 */
+ int i_field = ((i_field_idx - 1) & 1);
+ if (!b_top_field_first)
+ i_field ^= 1;
cc_AppendData( c, i_field, &cc[0] );
}