Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CVS
mac/ccextractor
linux/ccextractor
linux/depend
linux/build_scan/
windows/x86_64-pc-windows-msvc/**
windows/Debug/**
windows/Debug-OCR/**
Expand All @@ -28,6 +29,7 @@ windows/Debug-Full/**
windows/x64/**
windows/ccextractor.VC.db
build/
build_*/

####
# Python
Expand Down
9 changes: 4 additions & 5 deletions src/lib_ccx/avc_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,10 @@ void sei_rbsp(struct avc_ctx *ctx, unsigned char *seibuf, unsigned char *seiend)
}
else
{
// TODO: This really really looks bad
mprint("WARNING: Unexpected SEI unit length...trying to continue.");
temp_debug = 1;
mprint("\n Failed block (at sei_rbsp) was:\n");
dump(CCX_DMT_GENERIC_NOTICES, (unsigned char *)seibuf, seiend - seibuf, 0, 0);
// Unexpected SEI length - common with malformed streams, don't spam output
dbg_print(CCX_DMT_VERBOSE, "WARNING: Unexpected SEI unit length (parsed to %p, expected %p)...trying to continue.\n",
(void *)tbuf, (void *)(seiend - 1));
dump(CCX_DMT_VERBOSE, (unsigned char *)seibuf, seiend - seibuf, 0, 0);

ctx->num_unexpected_sei_length++;
}
Expand Down
1 change: 0 additions & 1 deletion src/lib_ccx/ccx_demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ struct ccx_demuxer *init_demuxer(void *parent, struct demuxer_cfg *cfg)
{
ctx->pinfo[i].got_important_streams_min_pts[j] = UINT64_MAX;
}
ctx->pinfo[i].initialized_ocr = 0;
ctx->pinfo[i].version = 0xFF; // Not real in a real stream since it's 5 bits. FF => Not initialized
}

Expand Down
1 change: 0 additions & 1 deletion src/lib_ccx/ccx_demuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct program_info
{
int pid;
int program_number;
int initialized_ocr; // Avoid initializing the OCR more than once
uint8_t analysed_PMT_once : 1;
uint8_t version;
uint8_t saved_section[1021];
Expand Down
5 changes: 2 additions & 3 deletions src/lib_ccx/dvb_subtitle_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void delete_regions(DVBSubContext *ctx)
* @return DVB context kept as void* for abstraction
*
*/
void *dvbsub_init_decoder(struct dvb_config *cfg, int initialized_ocr)
void *dvbsub_init_decoder(struct dvb_config *cfg)
{
int i, r, g, b, a = 0;
DVBSubContext *ctx = (DVBSubContext *)malloc(sizeof(DVBSubContext));
Expand All @@ -442,8 +442,7 @@ void *dvbsub_init_decoder(struct dvb_config *cfg, int initialized_ocr)
}

#ifdef ENABLE_OCR
if (!initialized_ocr)
ctx->ocr_ctx = init_ocr(ctx->lang_index);
ctx->ocr_ctx = init_ocr(ctx->lang_index);
#endif
ctx->version = -1;

Expand Down
2 changes: 1 addition & 1 deletion src/lib_ccx/dvb_subtitle_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C"
* @return DVB context kept as void* for abstraction
*
*/
void *dvbsub_init_decoder(struct dvb_config *cfg, int initialized_ocr);
void *dvbsub_init_decoder(struct dvb_config *cfg);

int dvbsub_close_decoder(void **dvb_ctx);

Expand Down
6 changes: 1 addition & 5 deletions src/lib_ccx/general_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int ps_get_more_data(struct lib_ccx_ctx *ctx, struct demuxer_data **ppdata)
if (!ctx->demux_ctx->strangeheader)
{
mprint("\nNot a recognized header. Searching for next header.\n");
dump(CCX_DMT_GENERIC_NOTICES, nextheader, 6, 0, 0);
dump(CCX_DMT_PARSE, nextheader, 6, 0, 0);
// Only print the message once per loop / unrecognized header
ctx->demux_ctx->strangeheader = 1;
}
Expand Down Expand Up @@ -809,10 +809,6 @@ int process_data(struct encoder_ctx *enc_ctx, struct lib_cc_decode *dec_ctx, str
got = data_node->len;
}
}
else if (data_node->bufferdatatype == CCX_PRIVATE_MPEG2_CC)
{
got = data_node->len; // Do nothing. Still don't know how to process it
}
else if (data_node->bufferdatatype == CCX_RAW) // Raw two byte 608 data from DVR-MS/ASF
{
// The asf_get_more_data() loop sets current_pts when possible
Expand Down
2 changes: 1 addition & 1 deletion src/lib_ccx/matroska.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ void parse_private_codec_data(struct matroska_ctx *mkv_ctx, char *codec_id_strin
memset((void *)&cnf, 0, sizeof(struct dvb_config));

parse_dvb_description(&cnf, codec_data, 8);
dec_ctx->private_data = dvbsub_init_decoder(&cnf, 0);
dec_ctx->private_data = dvbsub_init_decoder(&cnf);

free(codec_data);
}
Expand Down
18 changes: 4 additions & 14 deletions src/lib_ccx/ts_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ enum ccx_bufferdata_type get_buffer_type(struct cap_info *cinfo)
{
return CCX_TELETEXT;
}
else if (cinfo->stream == CCX_STREAM_TYPE_PRIVATE_MPEG2 && cinfo->codec == CCX_CODEC_ATSC_CC)
{
return CCX_PRIVATE_MPEG2_CC;
}
else if (cinfo->stream == CCX_STREAM_TYPE_PRIVATE_USER_MPEG2 && cinfo->codec == CCX_CODEC_ATSC_CC)
else if ((cinfo->stream == CCX_STREAM_TYPE_PRIVATE_MPEG2 ||
cinfo->stream == CCX_STREAM_TYPE_PRIVATE_USER_MPEG2) &&
cinfo->codec == CCX_CODEC_ATSC_CC)
{
// ATSC CC can be in either private stream type - process both as PES
return CCX_PES;
}
else
Expand Down Expand Up @@ -567,15 +566,6 @@ int copy_capbuf_demux_data(struct ccx_demuxer *ctx, struct demuxer_data **data,
if (!cinfo->capbuf || !cinfo->capbuflen)
return -1;

if (ptr->bufferdatatype == CCX_PRIVATE_MPEG2_CC)
{
dump(CCX_DMT_GENERIC_NOTICES, cinfo->capbuf, cinfo->capbuflen, 0, 1);
// Bogus data, so we return something
ptr->buffer[ptr->len++] = 0xFA;
ptr->buffer[ptr->len++] = 0x80;
ptr->buffer[ptr->len++] = 0x80;
return CCX_OK;
}
if (cinfo->codec == CCX_CODEC_TELETEXT)
{
memcpy(ptr->buffer + ptr->len, cinfo->capbuf, cinfo->capbuflen);
Expand Down
2 changes: 1 addition & 1 deletion src/lib_ccx/ts_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void *init_private_data(enum ccx_code_type codec)
case CCX_CODEC_TELETEXT:
return telxcc_init();
case CCX_CODEC_DVB:
return dvbsub_init_decoder(NULL, 0);
return dvbsub_init_decoder(NULL);
default:
return NULL;
}
Expand Down
4 changes: 1 addition & 3 deletions src/lib_ccx/ts_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,7 @@ int parse_PMT(struct ccx_demuxer *ctx, unsigned char *buf, int len, struct progr
ret = parse_dvb_description(&cnf, es_info, desc_len);
if (ret < 0)
break;
ptr = dvbsub_init_decoder(&cnf, pinfo->initialized_ocr);
if (!pinfo->initialized_ocr)
pinfo->initialized_ocr = 1;
ptr = dvbsub_init_decoder(&cnf);
if (ptr == NULL)
break;
update_capinfo(ctx, elementary_PID, stream_type, CCX_CODEC_DVB, program_number, ptr);
Expand Down
1 change: 0 additions & 1 deletion src/rust/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ impl CType<program_info> for ProgramInfo {
program_info {
pid: self.pid,
program_number: self.program_number,
initialized_ocr: self.initialized_ocr as c_int,
_bitfield_align_1: [],
_bitfield_1: bf1,
version: self.version,
Expand Down
1 change: 0 additions & 1 deletion src/rust/src/ctorust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ impl FromCType<program_info> for ProgramInfo {
Some(ProgramInfo {
pid: info.pid,
program_number: info.program_number,
initialized_ocr: info.initialized_ocr != 0,
analysed_pmt_once: info._bitfield_1.get_bit(0) as u8,
version: info.version,
saved_section: info.saved_section,
Expand Down
2 changes: 0 additions & 2 deletions src/rust/src/demuxer/common_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub struct FileReport {
pub struct ProgramInfo {
pub pid: i32,
pub program_number: i32,
pub initialized_ocr: bool, // Avoid initializing the OCR more than once
pub analysed_pmt_once: u8, // 1-bit field
pub version: u8,
pub saved_section: [u8; SAVED_SECTIONS_PROGRAMINFO],
Expand Down Expand Up @@ -301,7 +300,6 @@ impl Default for ProgramInfo {
ProgramInfo {
pid: -1,
program_number: 0,
initialized_ocr: false,
analysed_pmt_once: 0,
version: 0,
saved_section: [0; SAVED_SECTIONS_PROGRAMINFO],
Expand Down
Loading