File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ use crate::{
16
16
} ;
17
17
18
18
use log:: { debug, warn} ;
19
+ use service_decoder:: ccxr_flush_decoder;
19
20
20
21
const CCX_DTVCC_MAX_PACKET_LENGTH : u8 = 128 ;
21
22
const CCX_DTVCC_NO_LAST_SEQUENCE : i32 = -1 ;
@@ -260,6 +261,30 @@ impl<'a> Dtvcc<'a> {
260
261
}
261
262
}
262
263
264
+ #[ no_mangle]
265
+ extern "C" fn ccxr_flush_active_decoders ( ctx_ptr : * mut lib_cc_decode ) {
266
+ let ctx = unsafe { & mut * ctx_ptr } ;
267
+ let dtvcc_rust = unsafe { & mut * ( ctx. dtvcc_rust as * mut Dtvcc ) } ;
268
+
269
+ if dtvcc_rust. is_active {
270
+ for i in 0 ..CCX_DTVCC_MAX_SERVICES {
271
+ let decoder_opt = & dtvcc_rust. decoders [ i] ;
272
+ if decoder_opt. is_none ( ) {
273
+ continue ;
274
+ }
275
+ let decoder = decoder_opt. to_owned ( ) . unwrap ( ) ;
276
+
277
+ if is_true ( !dtvcc_rust. services_active [ i] ) {
278
+ continue ;
279
+ }
280
+ if decoder. cc_count > 0 {
281
+ ctx. current_field = 3 ;
282
+ ccxr_flush_decoder ( ctx. dtvcc_rust as * mut Dtvcc , Box :: into_raw ( decoder) ) ;
283
+ }
284
+ }
285
+ }
286
+ }
287
+
263
288
/// A single character symbol
264
289
///
265
290
/// sym stores the symbol
You can’t perform that action at this time.
0 commit comments