passing-subtitle-in-myth.c-n-sequencing.c

This commit is contained in:
Anshul Maheshwari 2014-07-12 12:53:13 +05:30
parent 3afcfa79e1
commit f1a493b999
2 changed files with 13 additions and 12 deletions

View File

@ -546,7 +546,7 @@ static int cc608_good_parity(const int *parity_table, unsigned int data)
}
void ProcessVBIDataPacket()
void ProcessVBIDataPacket(struct cc_subtitle *sub)
{
const unsigned char *meat = av.data;
@ -610,7 +610,7 @@ void ProcessVBIDataPacket()
ccdata[0]=0x04; // Field 1
ccdata[1]=meat[1];
ccdata[2]=meat[2];
do_cb(ccdata);
do_cb(ccdata,sub);
// processed_ccblocks++; // Not sure this is accurate
}
else
@ -618,7 +618,7 @@ void ProcessVBIDataPacket()
ccdata[0]=0x05; // Field 1
ccdata[1]=meat[1];
ccdata[2]=meat[2];
do_cb(ccdata);
do_cb(ccdata, sub);
}
}
// utc += 33367;
@ -824,6 +824,7 @@ void myth_loop(void)
int rc;
int has_vbi=0;
LLONG saved = 0;
struct cc_subtitle dec_sub;
av.data=NULL;
ccx_options.buffer_input = 1;
@ -848,7 +849,7 @@ void myth_loop(void)
has_vbi=1;
}
//fts_now=LLONG((processed_ccblocks*1000)/29.97);
ProcessVBIDataPacket ();
ProcessVBIDataPacket(&dec_sub);
}
/* This needs a lot more testing */
if (av.codec_id==CODEC_ID_MPEG2VIDEO && av.type==CODEC_TYPE_VIDEO )
@ -868,7 +869,7 @@ void myth_loop(void)
pts_set=1;
}
memcpy (desp+saved,av.data,av.size);
LLONG used = process_m2v(desp,length);
LLONG used = process_m2v(desp, length, &dec_sub);
memmove (desp,desp+used,(unsigned int) (length-used));
saved=length-used;
}

View File

@ -36,7 +36,7 @@ void init_hdcc (void)
}
// Buffer caption blocks for later sorting/flushing.
void store_hdcc(unsigned char *cc_data, int cc_count, int sequence_number, LLONG current_fts_now)
void store_hdcc(unsigned char *cc_data, int cc_count, int sequence_number, LLONG current_fts_now,struct cc_subtitle *sub)
{
// Uninitialized?
if (anchor_seq_number < 0)
@ -51,7 +51,7 @@ void store_hdcc(unsigned char *cc_data, int cc_count, int sequence_number, LLONG
// Maybe missing an anchor frame - try to recover
dbg_print(CCX_DMT_VERBOSE, "Too many B-frames, or missing anchor frame. Trying to recover ..\n");
process_hdcc();
process_hdcc(sub);
anchor_hdcc( sequence_number);
seq_index = sequence_number - anchor_seq_number + MAXBFRAMES;
}
@ -97,7 +97,7 @@ void anchor_hdcc(int seq)
}
// Sort/flash caption block buffer
void process_hdcc (void)
void process_hdcc (struct cc_subtitle *sub)
{
// Remember the current value
LLONG store_fts_now = fts_now;
@ -167,7 +167,7 @@ void process_hdcc (void)
cc_data_pkts[seq][j+1]=0x7F;
}
}
do_cb(cc_data_pkts[seq]+j);
do_cb(cc_data_pkts[seq]+j, sub);
} // for loop over packets
}
@ -180,7 +180,7 @@ void process_hdcc (void)
}
int do_cb (unsigned char *cc_block)
int do_cb (unsigned char *cc_block, struct cc_subtitle *sub)
{
unsigned char cc_valid = (*cc_block & 4) >>2;
unsigned char cc_type = *cc_block & 3;
@ -237,7 +237,7 @@ int do_cb (unsigned char *cc_block)
if (timeok)
{
if(ccx_options.write_format!=CCX_OF_RCWT)
printdata (cc_block+1,2,0,0);
printdata (cc_block+1,2,0,0, sub);
else
writercwtdata(cc_block);
}
@ -261,7 +261,7 @@ int do_cb (unsigned char *cc_block)
if (timeok)
{
if(ccx_options.write_format!=CCX_OF_RCWT)
printdata (0,0,cc_block+1,2);
printdata (0,0,cc_block+1,2, sub);
else
writercwtdata(cc_block);
}