Skip to content

Commit

Permalink
fix: mp4 code arguments & clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
IshanGrover2004 committed Aug 24, 2024
1 parent ee83a50 commit fc06c95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib_ccx/ccx_dtvcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void dtvcc_free(dtvcc_ctx **);
#ifndef DISABLE_RUST
extern void *ccxr_dtvcc_init(struct ccx_decoder_dtvcc_settings *settings_dtvcc);
extern void ccxr_dtvcc_free(void *dtvcc_rust);
extern void ccxr_dtvcc_process_data(void *dtvcc_rust, const unsigned char *data);
extern void ccxr_dtvcc_process_data(void *dtvcc_rust, const unsigned char cc_valid, const unsigned char cc_type, const unsigned char data1, const unsigned char data2);
#endif

#endif // CCEXTRACTOR_CCX_DTVCC_H
2 changes: 1 addition & 1 deletion src/lib_ccx/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static int process_clcp(struct lib_ccx_ctx *ctx, struct encoder_ctx *enc_ctx,

#ifndef DISABLE_RUST
ccxr_dtvcc_set_encoder(dec_ctx->dtvcc_rust, enc_ctx);
ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, (unsigned char *)temp);
ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, temp[0], temp[1], temp[2], temp[3]);
#else
dec_ctx->dtvcc->encoder = (void *)enc_ctx;
dtvcc_process_data(dec_ctx->dtvcc, (unsigned char *)temp);
Expand Down
11 changes: 9 additions & 2 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,15 @@ extern "C" fn ccxr_dtvcc_set_encoder(dtvcc_rust: *mut Dtvcc, encoder: *mut encod
unsafe { (*dtvcc_rust).encoder = encoder };
}

extern "C" fn ccxr_dtvcc_process_data(dtvcc_rust: *mut Dtvcc, data: &[u8]) {
unsafe { &mut (*dtvcc_rust) }.process_cc_data(data[0], data[1], data[2], data[3]);
#[no_mangle]
extern "C" fn ccxr_dtvcc_process_data(
dtvcc_rust: *mut Dtvcc,
cc_valid: u8,
cc_type: u8,
data1: u8,
data2: u8,
) {
unsafe { &mut (*dtvcc_rust) }.process_cc_data(cc_valid, cc_type, data1, data2);
}

/// Process cc_data
Expand Down

0 comments on commit fc06c95

Please sign in to comment.