@@ -19,6 +19,10 @@ int fsync(int fd)
1919}
2020#endif
2121
22+ #ifndef DISABLE_RUST
23+ int ccxr_get_str_basic (unsigned char * out_buffer , unsigned char * in_buffer , int trim_subs ,
24+ enum ccx_encoding_type in_enc , enum ccx_encoding_type out_enc , int max_len );
25+ #endif
2226// These are the default settings for plain transcripts. No times, no CC or caption mode, and no XDS.
2327ccx_encoders_transcript_format ccx_encoders_default_transcript_settings =
2428 {
@@ -293,6 +297,9 @@ int change_ascii_encoding(unsigned char *dest, unsigned char *src, int len, enum
293297int get_str_basic (unsigned char * out_buffer , unsigned char * in_buffer , int trim_subs ,
294298 enum ccx_encoding_type in_enc , enum ccx_encoding_type out_enc , int max_len )
295299{
300+ #ifndef DISABLE_RUST
301+ return ccxr_get_str_basic (out_buffer , in_buffer , trim_subs , in_enc , out_enc , max_len );
302+ #else
296303 int last_non_blank = -1 ;
297304 int first_non_blank = -1 ;
298305 int len = 0 ;
@@ -305,7 +312,6 @@ int get_str_basic(unsigned char *out_buffer, unsigned char *in_buffer, int trim_
305312 * out_buffer = 0 ;
306313 return 0 ;
307314 }
308-
309315 // change encoding only when required
310316 switch (in_enc )
311317 {
@@ -331,6 +337,7 @@ int get_str_basic(unsigned char *out_buffer, unsigned char *in_buffer, int trim_
331337 return (unsigned )len ; // Return length
332338
333339 return 0 ; // Return length
340+ #endif
334341}
335342
336343int write_subtitle_file_footer (struct encoder_ctx * ctx , struct ccx_s_write * out )
@@ -631,8 +638,8 @@ int write_cc_buffer_as_simplexml(struct eia608_screen *data, struct encoder_ctx
631638 if (data -> row_used [i ])
632639 {
633640 write_cc_line_as_simplexml (data , context , i );
641+ wrote_something = 1 ;
634642 }
635- wrote_something = 1 ;
636643 }
637644 return wrote_something ;
638645}
0 commit comments