+ /* CC from DVB/ATSC TS */
+ i_payload_type = CC_PAYLOAD_GA94;
+ }
+ else if( !memcmp( p_cc_dvd, p_src, 4 ) && i_src > 4+1 )
+ {
+ i_payload_type = CC_PAYLOAD_DVD;
+ }
+ else if( i_src >= 2+2 + 2+2 &&
+ ( ( !memcmp( p_cc_replaytv4a, &p_src[0], 2 ) && !memcmp( p_cc_replaytv4b, &p_src[4], 2 ) ) ||
+ ( !memcmp( p_cc_replaytv5a, &p_src[0], 2 ) && !memcmp( p_cc_replaytv5b, &p_src[4], 2 ) ) ) )
+ {
+ i_payload_type = CC_PAYLOAD_REPLAYTV;
+ }
+ else if( ( !memcmp( p_cc_scte20, p_src, 2 ) ||
+ !memcmp( p_cc_scte20_old, p_src, 2 ) ) && i_src > 2 )
+ {
+ i_payload_type = CC_PAYLOAD_SCTE20;
+ }
+ else
+ {
+#if 0
+#define V(x) ( ( x < 0x20 || x >= 0x7f ) ? '?' : x )
+ fprintf( stderr, "-------------- unknown user data " );
+ for( int i = 0; i < i_src; i++ )
+ fprintf( stderr, "%2.2x ", p_src[i] );
+ for( int i = 0; i < i_src; i++ )
+ fprintf( stderr, "%c ", V(p_src[i]) );
+ fprintf( stderr, "\n" );
+#undef V
+#endif
+ return;
+ }
+
+ if( c->i_payload_type != CC_PAYLOAD_NONE && c->i_payload_type != i_payload_type )
+ {
+ c->i_payload_other_count++;
+ if( c->i_payload_other_count < 50 )
+ return;
+ }
+ c->i_payload_type = i_payload_type;
+ c->i_payload_other_count = 0;
+
+ if( i_payload_type == CC_PAYLOAD_GA94 )
+ {