Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/multimedia/aribb24/files/patch-src_parser.c
16461 views
1
https://github.com/scimmia9286/aribb24/commit/58a34b8fabf4d0e9e1984fb603a97f52fb934a09
2
https://github.com/scimmia9286/aribb24/commit/fa54dee41aa38560f02868b24f911a24c33780a8
3
--- src/parser.c.orig 2019-09-16 15:57:19 UTC
4
+++ src/parser.c
5
@@ -79,7 +79,6 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par
6
uint8_t i_data_unit_parameter,
7
uint32_t i_data_unit_size )
8
{
9
- p_parser->p_instance->p->i_drcs_num = 0;
10
#ifdef ARIBSUB_GEN_DRCS_DATA
11
if( p_parser->p_drcs_data != NULL )
12
{
13
@@ -119,7 +118,7 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par
14
15
for( int i = 0; i < i_NumberOfCode; i++ )
16
{
17
- bs_skip( p_bs, 16 ); /* i_character_code */
18
+ int16_t i_CharacterCode = bs_read( p_bs, 16 ); /* i_character_code */
19
p_parser->i_data_unit_size += 2;
20
uint8_t i_NumberOfFont = bs_read( p_bs, 8 );
21
p_parser->i_data_unit_size += 1;
22
@@ -139,7 +138,11 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par
23
24
for( int j = 0; j < i_NumberOfFont; j++ )
25
{
26
+#ifdef ARIBSUB_GEN_DRCS_DATA
27
+ int8_t i_fontId = bs_read( p_bs, 4 ); /* i_fontID */
28
+#else
29
bs_skip( p_bs, 4 ); /* i_fontID */
30
+#endif //ARUBSUB_GEN_DRCS_DATA
31
uint8_t i_mode = bs_read( p_bs, 4 );
32
p_parser->i_data_unit_size += 1;
33
34
@@ -206,18 +209,26 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par
35
36
#ifdef ARIBSUB_GEN_DRCS_DATA
37
save_drcs_pattern( p_parser->p_instance, i_width, i_height, i_depth + 2,
38
- p_drcs_pattern_data->p_patternData );
39
+ p_drcs_pattern_data->p_patternData, i_CharacterCode );
40
#else
41
save_drcs_pattern( p_parser->p_instance, i_width, i_height, i_depth + 2,
42
- p_patternData );
43
+ p_patternData, i_CharacterCode );
44
free( p_patternData );
45
#endif //ARIBSUB_GEN_DRCS_DATA
46
}
47
else
48
{
49
+#ifdef ARIBSUB_GEN_DRCS_DATA
50
+ int8_t i_regionX = bs_read( p_bs, 8 ); /* i_regionX */
51
+#else
52
bs_skip( p_bs, 8 ); /* i_regionX */
53
+#endif //ARIBSUB_GEN_DRCS_DATA
54
p_parser->i_data_unit_size += 1;
55
+#ifdef ARIBSUB_GEN_DRCS_DATA
56
+ int8_t i_regionY = bs_read( p_bs, 8 ); /* i_regionY */
57
+#else
58
bs_skip( p_bs, 8 ); /* i_regionY */
59
+#endif //ARIBSUB_GEN_DRCS_DATA
60
p_parser->i_data_unit_size += 1;
61
uint16_t i_geometricData_length = bs_read( p_bs, 16 );
62
p_parser->i_data_unit_size += 2;
63
@@ -245,7 +256,11 @@ static void parse_data_unit_DRCS( arib_parser_t *p_par
64
65
for( int k = 0; k < i_geometricData_length ; k++ )
66
{
67
+#ifdef ARIBSUB_GEN_DRCS_DATA
68
+ int8_t i_geometricData = bs_read( p_bs, 8 ); /* i_geometric_data */
69
+#else
70
bs_skip( p_bs, 8 ); /* i_geometric_data */
71
+#endif //ARIBSUB_GEN_DRCS_DATA
72
p_parser->i_data_unit_size += 1;
73
74
#ifdef ARIBSUB_GEN_DRCS_DATA
75
@@ -344,6 +359,10 @@ static void parse_caption_management_data( arib_parser
76
p_parser->i_data_unit_size = 0;
77
p_parser->i_subtitle_data_size = 0;
78
p_parser->psz_subtitle_data = NULL;
79
+ memset(p_parser->p_instance->p->i_drcs_num, 0,
80
+ sizeof(p_parser->p_instance->p->i_drcs_num));
81
+ memset(p_parser->p_instance->p->drcs_hash_table, 0,
82
+ sizeof(p_parser->p_instance->p->drcs_hash_table));
83
if( i_data_unit_loop_length > 0 )
84
{
85
p_parser->psz_subtitle_data = (unsigned char*) calloc(
86
87