Skip to content

Commit 0e00666

Browse files
feat: Use of dtvcc init & free in C
1 parent 3bdbfd8 commit 0e00666

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib_ccx/ccx_decoders_common.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ int do_cb(struct lib_cc_decode *ctx, unsigned char *cc_block, struct cc_subtitle
219219
default:
220220
fatal(CCX_COMMON_EXIT_BUG_BUG, "In do_cb: Impossible value for cc_type, Please file a bug report on GitHub.\n");
221221
} // switch (cc_type)
222-
} // cc_valid
222+
} // cc_valid
223223
else
224224
{
225225
dbg_print(CCX_DMT_CBRAW, " .. .. ..\n");
@@ -232,7 +232,11 @@ int do_cb(struct lib_cc_decode *ctx, unsigned char *cc_block, struct cc_subtitle
232232
void dinit_cc_decode(struct lib_cc_decode **ctx)
233233
{
234234
struct lib_cc_decode *lctx = *ctx;
235+
#ifndef DISABLE_RUST
236+
ccxr_dtvcc_free(lctx->dtvcc_rust);
237+
#else
235238
dtvcc_free(&lctx->dtvcc);
239+
#endif
236240
dinit_avc(&lctx->avc_ctx);
237241
ccx_decoder_608_dinit_library(&lctx->context_cc608_field_1);
238242
ccx_decoder_608_dinit_library(&lctx->context_cc608_field_2);
@@ -261,8 +265,12 @@ struct lib_cc_decode *init_cc_decode(struct ccx_decoders_common_settings_t *sett
261265
ctx->no_rollup = setting->no_rollup;
262266
ctx->noscte20 = setting->noscte20;
263267

268+
#ifndef DISABLE_RUST
269+
ctx->dtvcc_rust = ccxr_dtvcc_init(setting->settings_dtvcc);
270+
#else
264271
ctx->dtvcc = dtvcc_init(setting->settings_dtvcc);
265272
ctx->dtvcc->is_active = setting->settings_dtvcc->enabled;
273+
#endif
266274

267275
if (setting->codec == CCX_CODEC_ATSC_CC)
268276
{

0 commit comments

Comments
 (0)