@@ -6,6 +6,7 @@ License: GPL 2.0
6
6
#include "ccextractor.h"
7
7
#include <stdio.h>
8
8
#include <locale.h>
9
+ #include <ccx_encoders_helpers.h>
9
10
10
11
volatile int terminate_asap = 0 ;
11
12
@@ -138,10 +139,27 @@ int start_ccx()
138
139
#endif
139
140
terminate_asap = 0 ;
140
141
142
+ #ifdef ENABLE_SHARING
143
+ if (ccx_options .translate_enabled && ctx -> num_input_files > 1 )
144
+ {
145
+ mprint ("[share] WARNING: simultaneous translation of several input files is not supported yet\n" );
146
+ ccx_options .translate_enabled = 0 ;
147
+ ccx_options .sharing_enabled = 0 ;
148
+ }
149
+ if (ccx_options .translate_enabled )
150
+ {
151
+ mprint ("[share] launching translate service\n" );
152
+ ccx_share_launch_translator (ccx_options .translate_langs , ccx_options .translate_key );
153
+ }
154
+ #endif // ENABLE_SHARING
141
155
ret = 0 ;
142
156
while (switch_to_next_file (ctx , 0 ))
143
157
{
144
158
prepare_for_new_file (ctx );
159
+ #ifdef ENABLE_SHARING
160
+ if (ccx_options .sharing_enabled )
161
+ ccx_share_start (ctx -> basefilename );
162
+ #endif // ENABLE_SHARING
145
163
146
164
stream_mode = ctx -> demux_ctx -> get_stream_mode (ctx -> demux_ctx );
147
165
// Disable sync check for raw formats - they have the right timeline.
@@ -293,6 +311,14 @@ int start_ccx()
293
311
dec_ctx -> timing -> fts_now = 0 ;
294
312
dec_ctx -> timing -> fts_max = 0 ;
295
313
314
+ #ifdef ENABLE_SHARING
315
+ if (ccx_options .sharing_enabled )
316
+ {
317
+ ccx_share_stream_done (ctx -> basefilename );
318
+ ccx_share_stop ();
319
+ }
320
+ #endif // ENABLE_SHARING
321
+
296
322
if (dec_ctx -> total_pulldownframes )
297
323
mprint ("incl. pulldown frames: %s (%u frames at %.2ffps)\n" ,
298
324
print_mstime_static ((LLONG )(dec_ctx -> total_pulldownframes * 1000 / current_fps )),
@@ -391,8 +417,10 @@ int start_ccx()
391
417
dinit_libraries (& ctx );
392
418
393
419
if (!ret )
420
+ {
421
+ webvtt_write_minimal_header ();
394
422
mprint ("\nNo captions were found in input.\n" );
395
-
423
+ }
396
424
print_end_msg ();
397
425
398
426
if (show_myth_banner )
0 commit comments