@@ -9,16 +9,14 @@ void ccxr_demuxer_close(struct ccx_demuxer *ctx);
99int ccxr_demuxer_isopen (const struct ccx_demuxer * ctx );
1010int ccxr_demuxer_open (struct ccx_demuxer * ctx , const char * file );
1111LLONG ccxr_demuxer_get_file_size (struct ccx_demuxer * ctx );
12- int ccxr_demuxer_get_stream_mode (const struct ccx_demuxer * ctx );
1312void ccxr_demuxer_print_cfg (const struct ccx_demuxer * ctx );
14- void ccxr_demuxer_delete (struct ccx_demuxer * * ctx );
1513#endif
1614
1715static void ccx_demuxer_reset (struct ccx_demuxer * ctx )
1816{
19- // #ifndef DISABLE_RUST
20- // ccxr_demuxer_reset(ctx);
21- // #else
17+ #ifndef DISABLE_RUST
18+ ccxr_demuxer_reset (ctx );
19+ #else
2220 ctx -> startbytes_pos = 0 ;
2321 ctx -> startbytes_avail = 0 ;
2422 ctx -> num_of_PIDs = 0 ;
@@ -30,39 +28,38 @@ static void ccx_demuxer_reset(struct ccx_demuxer *ctx)
3028 }
3129 memset (ctx -> stream_id_of_each_pid , 0 , (MAX_PSI_PID + 1 ) * sizeof (uint8_t ));
3230 memset (ctx -> PIDs_programs , 0 , 65536 * sizeof (struct PMT_entry * ));
33- // #endif
31+ #endif
3432}
3533
3634static void ccx_demuxer_close (struct ccx_demuxer * ctx )
3735{
38- // #ifndef DISABLE_RUST
39- // ccxr_demuxer_close(ctx);
40- // mprint("ctx.past = %lld\n", ctx->past);
41- // mprint("ctx.infd = %lld\n", ctx->infd);
42- // #else
36+ #ifndef DISABLE_RUST
37+ ccxr_demuxer_close (ctx );
38+ #else
4339 ctx -> past = 0 ;
4440 if (ctx -> infd != -1 && ccx_options .input_source == CCX_DS_FILE )
4541 {
4642 close (ctx -> infd );
4743 ctx -> infd = -1 ;
4844 activity_input_file_closed ();
4945 }
50- // #endif
46+ #endif
5147}
5248
5349static int ccx_demuxer_isopen (struct ccx_demuxer * ctx )
5450{
55- // #ifndef DISABLE_RUST
56- // return ccxr_demuxer_isopen(ctx);
57- // #else
51+ #ifndef DISABLE_RUST
52+ return ccxr_demuxer_isopen (ctx );
53+ #else
5854 return ctx -> infd != -1 ;
59- // #endif
55+ #endif
6056}
57+
6158static int ccx_demuxer_open (struct ccx_demuxer * ctx , const char * file )
6259{
63- // #ifndef DISABLE_RUST
64- // return ccxr_demuxer_open(ctx, file);
65- // #else
60+ #ifndef DISABLE_RUST
61+ return ccxr_demuxer_open (ctx , file );
62+ #else
6663 ctx -> past = 0 ;
6764 ctx -> min_global_timestamp = 0 ;
6865 ctx -> global_timestamp_inited = 0 ;
@@ -220,13 +217,14 @@ static int ccx_demuxer_open(struct ccx_demuxer *ctx, const char *file)
220217 }
221218
222219 return 0 ;
223- // #endif
220+ #endif
224221}
222+
225223LLONG ccx_demuxer_get_file_size (struct ccx_demuxer * ctx )
226224{
227- // #ifndef DISABLE_RUST
228- // return ccxr_demuxer_get_file_size(ctx);
229- // #else
225+ #ifndef DISABLE_RUST
226+ return ccxr_demuxer_get_file_size (ctx );
227+ #else
230228 LLONG ret = 0 ;
231229 int in = ctx -> infd ;
232230 LLONG current = LSEEK (in , 0 , SEEK_CUR );
@@ -239,23 +237,19 @@ LLONG ccx_demuxer_get_file_size(struct ccx_demuxer *ctx)
239237 return -1 ;
240238
241239 return length ;
242- // #endif
240+ #endif
243241}
244242
245243static int ccx_demuxer_get_stream_mode (struct ccx_demuxer * ctx )
246244{
247- // #ifndef DISABLE_RUST
248- // return ccxr_demuxer_get_stream_mode(ctx);
249- // #else
250245 return ctx -> stream_mode ;
251- // #endif
252246}
253247
254248static void ccx_demuxer_print_cfg (struct ccx_demuxer * ctx )
255249{
256- // #ifndef DISABLE_RUST
257- // ccxr_demuxer_print_cfg(ctx);
258- // #else
250+ #ifndef DISABLE_RUST
251+ ccxr_demuxer_print_cfg (ctx );
252+ #else
259253 switch (ctx -> auto_stream )
260254 {
261255 case CCX_SM_ELEMENTARY_OR_NOT_FOUND :
@@ -300,14 +294,11 @@ static void ccx_demuxer_print_cfg(struct ccx_demuxer *ctx)
300294 fatal (CCX_COMMON_EXIT_BUG_BUG , "BUG: Unknown stream mode. Please file a bug report on Github.\n" );
301295 break ;
302296 }
303- // #endif
297+ #endif
304298}
305299
306300void ccx_demuxer_delete (struct ccx_demuxer * * ctx )
307301{
308- // #ifndef DISABLE_RUST
309- // ccxr_demuxer_delete(ctx);
310- // #else
311302 struct ccx_demuxer * lctx = * ctx ;
312303 int i ;
313304 dinit_cap (lctx );
@@ -330,7 +321,6 @@ void ccx_demuxer_delete(struct ccx_demuxer **ctx)
330321
331322 freep (& lctx -> filebuffer );
332323 freep (ctx );
333- // #endif
334324}
335325
336326struct ccx_demuxer * init_demuxer (void * parent , struct demuxer_cfg * cfg )
@@ -451,4 +441,4 @@ struct demuxer_data *alloc_demuxer_data(void)
451441 data -> next_stream = 0 ;
452442 data -> next_program = 0 ;
453443 return data ;
454- }
444+ }
0 commit comments