summaryrefslogtreecommitdiffstats
path: root/libhb/deccc608sub.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/deccc608sub.c')
-rw-r--r--libhb/deccc608sub.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libhb/deccc608sub.c b/libhb/deccc608sub.c
index 8ac6642da..03c544f20 100644
--- a/libhb/deccc608sub.c
+++ b/libhb/deccc608sub.c
@@ -135,6 +135,7 @@ static int general_608_init (struct s_write *wb)
hb_buffer_list_clear(&wb->list);
wb->last_pts = 0;
+ wb->last_scr_sequence = 0;
return 0;
}
@@ -944,6 +945,7 @@ static int write_cc_buffer_as_ssa(struct eia608_screen *data,
buffer->s.frametype = HB_FRAME_SUBTITLE;
buffer->s.start = ms_start;
buffer->s.stop = AV_NOPTS_VALUE;
+ buffer->s.scr_sequence = wb->data608->current_visible_scr_sequence;
sprintf((char*)buffer->data, "%d,,Default,,0,0,0,,", ++wb->line);
len = strlen((char*)buffer->data);
memcpy(buffer->data + len, wb->enc_buffer, wb->enc_buffer_used);
@@ -958,6 +960,7 @@ static int write_cc_buffer_as_ssa(struct eia608_screen *data,
buffer->s.flags = HB_BUF_FLAG_EOS;
buffer->s.start = ms_start;
buffer->s.stop = ms_start;
+ buffer->s.scr_sequence = wb->data608->current_visible_scr_sequence;
hb_buffer_list_append(&wb->list, buffer);
wb->clear_sub_needed = 0;
}
@@ -1232,10 +1235,12 @@ static void handle_command(unsigned char c1, const unsigned char c2,
case COM_RESUMECAPTIONLOADING:
wb->data608->mode=MODE_POPUP;
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
break;
case COM_RESUMETEXTDISPLAY:
wb->data608->mode=MODE_TEXT;
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
break;
case COM_ROLLUP2:
if (wb->data608->rollup_base_row + 1 < 2)
@@ -1260,6 +1265,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
wb->rollup_cr = 1;
}
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
wb->data608->mode=MODE_ROLLUP_2;
erase_memory (wb, 0);
wb->data608->cursor_column = 0;
@@ -1287,6 +1293,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
wb->rollup_cr = 1;
}
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
wb->data608->mode=MODE_ROLLUP_3;
erase_memory (wb, 0);
wb->data608->cursor_column = 0;
@@ -1314,6 +1321,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
wb->rollup_cr = 1;
}
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
wb->data608->mode = MODE_ROLLUP_4;
wb->data608->cursor_column = 0;
wb->data608->cursor_row = wb->data608->rollup_base_row;
@@ -1328,6 +1336,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
{
wb->rollup_cr = 0;
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
break;
}
if (write_cc_buffer(wb))
@@ -1335,6 +1344,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
roll_up(wb);
wb->data608->cursor_column = 0;
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
break;
case COM_ERASENONDISPLAYEDMEMORY:
erase_memory (wb,0);
@@ -1353,6 +1363,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
// the last pts is the time to remove the previously
// displayed CC from the display
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
// Write "clear" subtitle if necessary
struct eia608_screen *data;
@@ -1367,6 +1378,7 @@ static void handle_command(unsigned char c1, const unsigned char c2,
{
swap_visible_buffer(wb);
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
}
if (write_cc_buffer(wb))
wb->data608->screenfuls_counter++;
@@ -1732,6 +1744,7 @@ static void process608(const unsigned char *data, int length,
// write a buffer now
write_cc_buffer(wb);
wb->data608->current_visible_start_ms = wb->last_pts;
+ wb->data608->current_visible_scr_sequence = wb->last_scr_sequence;
}
}
}
@@ -1811,6 +1824,7 @@ static int decccWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
}
pv->cc608->last_pts = in->s.start;
+ pv->cc608->last_scr_sequence = in->s.scr_sequence;
process608(in->data, in->size, pv->cc608);
/*