Skip to content

Commit fc06c95

Browse files
fix: mp4 code arguments & clippy warning
1 parent ee83a50 commit fc06c95

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
@@ -133,8 +133,15 @@ extern "C" fn ccxr_dtvcc_set_encoder(dtvcc_rust: *mut Dtvcc, encoder: *mut encod
133133
unsafe { (*dtvcc_rust).encoder = encoder };
134134
}
135135

136-
extern "C" fn ccxr_dtvcc_process_data(dtvcc_rust: *mut Dtvcc, data: &[u8]) {
137-
unsafe { &mut (*dtvcc_rust) }.process_cc_data(data[0], data[1], data[2], data[3]);
136+
#[no_mangle]
137+
extern "C" fn ccxr_dtvcc_process_data(
138+
dtvcc_rust: *mut Dtvcc,
139+
cc_valid: u8,
140+
cc_type: u8,
141+
data1: u8,
142+
data2: u8,
143+
) {
144+
unsafe { &mut (*dtvcc_rust) }.process_cc_data(cc_valid, cc_type, data1, data2);
138145
}
139146

140147
/// Process cc_data

0 commit comments

Comments
 (0)