Skip to content

Commit 2c67381

Browse files
cfsmp3claude
andcommitted
fix(windows): Fix c_long ABI mismatch in demuxer.rs
The extern declaration for ccxr_add_current_pts used c_long, but the actual implementation in time.rs uses i64. This caused an ABI mismatch on Windows where: - c_long = i32 (32-bit) - i64 = 64-bit On Linux both are 64-bit so it worked, but on Windows the type mismatch could cause incorrect parameter passing. Changes: - Change extern fn declaration from c_long to i64 - Remove unnecessary cast (FRAME_DURATION_TICKS is already i64) - Remove unused c_long import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 25d68b7 commit 2c67381

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rust/src/libccxr_exports/demuxer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use lib_ccxr::common::{Codec, Options, StreamMode, StreamType};
99
use lib_ccxr::time::Timestamp;
1010
use std::alloc::{alloc_zeroed, Layout};
1111
use std::ffi::CStr;
12-
use std::os::raw::{c_char, c_int, c_long, c_longlong, c_uchar, c_uint, c_void};
12+
use std::os::raw::{c_char, c_int, c_longlong, c_uchar, c_uint, c_void};
1313

1414
// External C function declarations
1515
extern "C" {
@@ -482,7 +482,7 @@ use crate::demuxer::dvdraw::{is_dvdraw_header, parse_dvdraw_with_callbacks, FRAM
482482
// External C function declarations for caption processing
483483
extern "C" {
484484
fn do_cb(ctx: *mut lib_cc_decode, cc_block: *mut c_uchar, sub: *mut cc_subtitle) -> c_int;
485-
fn ccxr_add_current_pts(ctx: *mut ccx_common_timing_ctx, pts: c_long);
485+
fn ccxr_add_current_pts(ctx: *mut ccx_common_timing_ctx, pts: i64);
486486
fn ccxr_set_fts(ctx: *mut ccx_common_timing_ctx) -> c_int;
487487
}
488488

@@ -546,7 +546,7 @@ pub unsafe extern "C" fn ccxr_process_dvdraw(
546546
},
547547
|| {
548548
// Advance timing before each field 1 caption
549-
ccxr_add_current_pts(timing_ctx, FRAME_DURATION_TICKS as c_long);
549+
ccxr_add_current_pts(timing_ctx, FRAME_DURATION_TICKS);
550550
ccxr_set_fts(timing_ctx);
551551
},
552552
);

0 commit comments

Comments
 (0)