File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ mod timing;
10
10
mod tv_screen;
11
11
mod window;
12
12
13
+ use crate :: { bindings:: * , utils:: * } ;
13
14
use lib_ccxr:: {
14
15
debug, fatal,
15
16
util:: log:: { DebugMessageFlag , ExitCause } ,
16
17
} ;
17
-
18
- use crate :: { bindings:: * , utils:: * } ;
18
+ use service_decoder:: ccxr_flush_decoder;
19
19
20
20
const CCX_DTVCC_MAX_PACKET_LENGTH : u8 = 128 ;
21
21
const CCX_DTVCC_NO_LAST_SEQUENCE : i32 = -1 ;
@@ -261,6 +261,30 @@ impl<'a> Dtvcc<'a> {
261
261
}
262
262
}
263
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
+
264
288
/// A single character symbol
265
289
///
266
290
/// sym stores the symbol
You can’t perform that action at this time.
0 commit comments