Skip to content

Commit 2188990

Browse files
fix: mp4 code arguments & clippy warning
1 parent 1c33be8 commit 2188990

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/lib_ccx/ccx_dtvcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void dtvcc_free(dtvcc_ctx **);
1313
#ifndef DISABLE_RUST
1414
extern void *ccxr_dtvcc_init(struct ccx_decoder_dtvcc_settings *settings_dtvcc);
1515
extern void ccxr_dtvcc_free(void *dtvcc_rust);
16-
extern void ccxr_dtvcc_process_data(void *dtvcc_rust, const unsigned char *data);
16+
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);
1717
#endif
1818

1919
#endif // CCEXTRACTOR_CCX_DTVCC_H

src/lib_ccx/mp4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static int process_clcp(struct lib_ccx_ctx *ctx, struct encoder_ctx *enc_ctx,
420420

421421
#ifndef DISABLE_RUST
422422
ccxr_dtvcc_set_encoder(dec_ctx->dtvcc_rust, enc_ctx);
423-
ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, (unsigned char *)temp);
423+
ccxr_dtvcc_process_data(dec_ctx->dtvcc_rust, temp[0], temp[1], temp[2], temp[3]);
424424
#else
425425
dec_ctx->dtvcc->encoder = (void *)enc_ctx;
426426
dtvcc_process_data(dec_ctx->dtvcc, (unsigned char *)temp);

src/rust/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ extern "C" fn ccxr_dtvcc_set_encoder(dtvcc_rust: *mut Dtvcc, encoder: *mut encod
104104
unsafe { (*dtvcc_rust).encoder = encoder };
105105
}
106106

107-
extern "C" fn ccxr_dtvcc_process_data(dtvcc_rust: *mut Dtvcc, data: &[u8]) {
108-
unsafe { &mut (*dtvcc_rust) }.process_cc_data(data[0], data[1], data[2], data[3]);
107+
#[no_mangle]
108+
extern "C" fn ccxr_dtvcc_process_data(
109+
dtvcc_rust: *mut Dtvcc,
110+
cc_valid: u8,
111+
cc_type: u8,
112+
data1: u8,
113+
data2: u8,
114+
) {
115+
unsafe { &mut (*dtvcc_rust) }.process_cc_data(cc_valid, cc_type, data1, data2);
109116
}
110117

111118
/// Process cc_data

0 commit comments

Comments
 (0)