Skip to content

Commit 1b69848

Browse files
feat: Add dtvcc_rust field for storing rust Dtvcc struct
1 parent 1a3384c commit 1b69848

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/lib_ccx/ccx_decoders_common.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ 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+
236+
#ifndef DISABLE_RUST
237+
ccxr_dtvcc_free(lctx->dtvcc_rust);
238+
#endif
235239
dtvcc_free(&lctx->dtvcc);
236240
dinit_avc(&lctx->avc_ctx);
237241
ccx_decoder_608_dinit_library(&lctx->context_cc608_field_1);
@@ -261,6 +265,9 @@ 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+
#endif
264271
ctx->dtvcc = dtvcc_init(setting->settings_dtvcc);
265272
ctx->dtvcc->is_active = setting->settings_dtvcc->enabled;
266273

src/lib_ccx/ccx_decoders_structs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ struct lib_cc_decode
208208
int stat_divicom;
209209
int false_pict_header;
210210

211+
// For storing Dtvcc struct initialised in rust
212+
void* dtvcc_rust;
213+
211214
dtvcc_ctx *dtvcc;
212215
int current_field;
213216
// Analyse/use the picture information

0 commit comments

Comments
 (0)