Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
02c0a4d4
Commit
02c0a4d4
authored
Jan 07, 2018
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codec: t140: output merged segments
parent
d4df22f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
modules/codec/t140.c
modules/codec/t140.c
+25
-4
No files found.
modules/codec/t140.c
View file @
02c0a4d4
...
...
@@ -86,7 +86,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
subpicture_region_t
*
p_region
;
block_t
*
p_block
;
size_t
len
;
size_t
len
=
0
;
if
(
p_spu
==
NULL
)
return
NULL
;
...
...
@@ -99,9 +99,30 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
return
NULL
;
/* This should already be UTF-8 encoded, so not much effort... */
len
=
strlen
(
p_region
->
p_text
->
psz_text
);
p_block
=
block_Alloc
(
len
);
memcpy
(
p_block
->
p_buffer
,
p_region
->
p_text
->
psz_text
,
len
);
for
(
const
text_segment_t
*
p_segment
=
p_region
->
p_text
;
p_segment
;
p_segment
=
p_segment
->
p_next
)
{
if
(
p_segment
->
psz_text
==
NULL
)
continue
;
len
+=
strlen
(
p_segment
->
psz_text
);
}
p_block
=
block_Alloc
(
len
+
1
);
if
(
!
p_block
)
return
NULL
;
p_block
->
i_buffer
=
0
;
for
(
const
text_segment_t
*
p_segment
=
p_region
->
p_text
;
p_segment
;
p_segment
=
p_segment
->
p_next
)
{
if
(
p_segment
->
psz_text
==
NULL
)
continue
;
len
=
strlen
(
p_segment
->
psz_text
);
memcpy
(
&
p_block
->
p_buffer
[
p_block
->
i_buffer
],
p_segment
->
psz_text
,
len
);
p_block
->
i_buffer
+=
len
;
}
p_block
->
p_buffer
[
p_block
->
i_buffer
]
=
0
;
p_block
->
i_pts
=
p_block
->
i_dts
=
p_spu
->
i_start
;
if
(
!
p_spu
->
b_ephemer
&&
(
p_spu
->
i_stop
>
p_spu
->
i_start
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment