Skip to content

Commit fc6835b

Browse files
committed
Hardsubx error fixed
1 parent fa970c5 commit fc6835b

File tree

21 files changed

+585
-433
lines changed

21 files changed

+585
-433
lines changed

src/lib_ccx/ccx_gxf.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ int ccxr_read_packet(struct ccx_demuxer *ctx, struct demuxer_data *data);
5353
int ccxr_gxf_probe(const unsigned char *buf, int len);
5454
#endif
5555

56-
57-
5856
typedef enum
5957
{
6058
PKT_MAP = 0xbc,

src/rust/Cargo.lock

Lines changed: 45 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ crate-type = ["staticlib"]
1414
log = "0.4.26"
1515
env_logger = "0.8.4"
1616
iconv = "0.1.1"
17+
palette = "0.6.1"
1718
rsmpeg = { version = "0.14.2", optional = true, features = [
1819
"link_system_ffmpeg",
1920
] }
@@ -26,8 +27,7 @@ time = "0.3.39"
2627
cfg-if = "1.0.0"
2728
num-integer = "0.1.46"
2829
lib_ccxr = { path = "lib_ccxr" }
29-
url = "2.5.2"
30-
palette = "0.7.6"
30+
url = "2.5.4"
3131

3232
[build-dependencies]
3333
bindgen = "0.64.0"

src/rust/lib_ccxr/src/activity.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub trait ActivityExt {
1111
fn activity_input_file_closed(&mut self);
1212
fn activity_input_file_open(&mut self, filename: &str);
1313
fn activity_report_data_read(&mut self);
14-
1514
}
1615
impl ActivityExt for Options {
1716
fn activity_report_version(&mut self) {
@@ -41,14 +40,16 @@ impl ActivityExt for Options {
4140
fn activity_report_data_read(&mut self) {
4241
if self.gui_mode_reports {
4342
let mut stderr = io::stderr();
44-
writeln!(stderr, "###DATAREAD#{}", unsafe { NET_ACTIVITY_GUI.load(Ordering::SeqCst)/ 1000 }).unwrap();
43+
writeln!(stderr, "###DATAREAD#{}", unsafe {
44+
NET_ACTIVITY_GUI.load(Ordering::SeqCst) / 1000
45+
})
46+
.unwrap();
4547
stderr.flush().unwrap();
4648
}
4749
}
48-
4950
}
5051
pub fn update_net_activity_gui(value: usize) {
5152
unsafe {
5253
NET_ACTIVITY_GUI.store(value, Ordering::SeqCst);
5354
}
54-
}
55+
}
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
pub struct AvcCtx {
2-
pub cc_count: u8, // Number of closed caption blocks
3-
pub cc_data: *mut u8, // Pointer to buffer holding CC data
2+
pub cc_count: u8, // Number of closed caption blocks
3+
pub cc_data: *mut u8, // Pointer to buffer holding CC data
44
pub cc_databufsize: i64, // Buffer size for CC data
5-
pub cc_buffer_saved: i32, // Was the CC buffer saved after the last update?
5+
pub cc_buffer_saved: i32, // Was the CC buffer saved after the last update?
66

7-
pub got_seq_para: i32, // Flag indicating if sequence parameters were received
7+
pub got_seq_para: i32, // Flag indicating if sequence parameters were received
88
pub nal_ref_idc: u32, // NAL reference ID
9-
pub seq_parameter_set_id: i64, // Sequence parameter set ID
10-
pub log2_max_frame_num: i32, // Log2 of max frame number
11-
pub pic_order_cnt_type: i32, // Picture order count type
12-
pub log2_max_pic_order_cnt_lsb: i32, // Log2 of max picture order count LSB
13-
pub frame_mbs_only_flag: i32, // Flag indicating if only frame MBs are used
9+
pub seq_parameter_set_id: i64, // Sequence parameter set ID
10+
pub log2_max_frame_num: i32, // Log2 of max frame number
11+
pub pic_order_cnt_type: i32, // Picture order count type
12+
pub log2_max_pic_order_cnt_lsb: i32, // Log2 of max picture order count LSB
13+
pub frame_mbs_only_flag: i32, // Flag indicating if only frame MBs are used
1414

1515
// Use and throw stats for debugging (TODO: clean up later)
16-
pub num_nal_unit_type_7: i64, // Number of NAL units of type 7
17-
pub num_vcl_hrd: i64, // Number of VCL HRD parameters encountered
18-
pub num_nal_hrd: i64, // Number of NAL HRD parameters encountered
19-
pub num_jump_in_frames: i64, // Number of frame jumps detected
20-
pub num_unexpected_sei_length: i64, // Number of unexpected SEI lengths
16+
pub num_nal_unit_type_7: i64, // Number of NAL units of type 7
17+
pub num_vcl_hrd: i64, // Number of VCL HRD parameters encountered
18+
pub num_nal_hrd: i64, // Number of NAL HRD parameters encountered
19+
pub num_jump_in_frames: i64, // Number of frame jumps detected
20+
pub num_unexpected_sei_length: i64, // Number of unexpected SEI lengths
2121

22-
pub ccblocks_in_avc_total: i32, // Total CC blocks in AVC stream
22+
pub ccblocks_in_avc_total: i32, // Total CC blocks in AVC stream
2323
pub ccblocks_in_avc_lost: i32, // Lost CC blocks in AVC stream
2424

25-
pub frame_num: i64, // Current frame number
26-
pub lastframe_num: i64, // Last processed frame number
27-
pub currref: i32, // Current reference index
28-
pub maxidx: i32, // Maximum index value for ordering
29-
pub lastmaxidx: i32, // Last max index
25+
pub frame_num: i64, // Current frame number
26+
pub lastframe_num: i64, // Last processed frame number
27+
pub currref: i32, // Current reference index
28+
pub maxidx: i32, // Maximum index value for ordering
29+
pub lastmaxidx: i32, // Last max index
3030

3131
// Used to find tref zero in PTS mode
32-
pub minidx: i32, // Minimum reference index
33-
pub lastminidx: i32, // Last minimum reference index
32+
pub minidx: i32, // Minimum reference index
33+
pub lastminidx: i32, // Last minimum reference index
3434

3535
// Used to remember the max temporal reference number (POC mode)
36-
pub maxtref: i32, // Max temporal reference
37-
pub last_gop_maxtref: i32, // Last GOP max temporal reference
36+
pub maxtref: i32, // Max temporal reference
37+
pub last_gop_maxtref: i32, // Last GOP max temporal reference
3838

3939
// Used for PTS ordering of CC blocks
40-
pub currefpts: i64, // Current reference PTS
41-
pub last_pic_order_cnt_lsb: i64, // Last picture order count LSB
42-
pub last_slice_pts: i64, // Last slice PTS
40+
pub currefpts: i64, // Current reference PTS
41+
pub last_pic_order_cnt_lsb: i64, // Last picture order count LSB
42+
pub last_slice_pts: i64, // Last slice PTS
4343
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod avc_functions;
1+
pub mod avc_functions;

src/rust/lib_ccxr/src/common/constants.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ impl From<u32> for DataSource {
258258
}
259259
}
260260

261-
262261
#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
263262
pub enum StreamMode {
264263
#[default]
@@ -643,4 +642,4 @@ impl PartialEq for BufferdataType {
643642
fn eq(&self, other: &Self) -> bool {
644643
std::mem::discriminant(self) == std::mem::discriminant(other)
645644
}
646-
}
645+
}

src/rust/lib_ccxr/src/demuxer/common_structs.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use crate::time::Timestamp;
21
use crate::demuxer::xds::XdsContext;
2+
use crate::time::Timestamp;
33

44
const MAXBFRAMES: usize = 50;
55
const SORTBUF: usize = 2 * MAXBFRAMES + 1;
66

7-
8-
97
pub const CCX_OK: i32 = 0;
108
pub const CCX_FALSE: i32 = 0;
119
pub const CCX_TRUE: i32 = 1;
@@ -31,9 +29,9 @@ pub struct LibCcDecode {
3129
pub write_format: crate::common::OutputFormat, // 0 = Raw, 1 = srt, 2 = SMI
3230
pub extraction_start: Option<Timestamp>,
3331
pub extraction_end: Option<Timestamp>, // Segment we actually process
34-
pub subs_delay: i64, // ms to delay (or advance) subs
35-
pub extract: i32, // Extract 1st, 2nd or both fields
36-
pub fullbin: i32, // Disable pruning of padding cc blocks
32+
pub subs_delay: i64, // ms to delay (or advance) subs
33+
pub extract: i32, // Extract 1st, 2nd or both fields
34+
pub fullbin: i32, // Disable pruning of padding cc blocks
3735
// TODO when cc_subtitle completed
3836
// pub dec_sub: cc_subtitle,
3937
pub in_bufferdatatype: crate::common::BufferdataType,
@@ -198,4 +196,4 @@ impl Default for LibCcDecode {
198196
prev: std::ptr::null_mut(),
199197
}
200198
}
201-
}
199+
}

0 commit comments

Comments
 (0)