Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d3d8a8c0
Commit
d3d8a8c0
authored
Nov 12, 2013
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zvbi: strip leading/end whitespaces from text subtitles
parent
a493cee2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
bindings/python
bindings/python
+1
-1
modules/codec/zvbi.c
modules/codec/zvbi.c
+15
-4
No files found.
python
@
e4ce04bc
Subproject commit
391f6383e9568209c3242468c4179645708bdc39
Subproject commit
e4ce04bca758d81550894dc88351d96526723278
modules/codec/zvbi.c
View file @
d3d8a8c0
...
@@ -42,6 +42,8 @@
...
@@ -42,6 +42,8 @@
# include "config.h"
# include "config.h"
#endif
#endif
#include <ctype.h>
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include <assert.h>
#include <assert.h>
...
@@ -414,15 +416,24 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
...
@@ -414,15 +416,24 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_text
)
if
(
p_sys
->
b_text
)
{
{
unsigned
int
i_textsize
=
7000
;
unsigned
int
i_textsize
=
7000
;
int
i_total
;
int
i_total
,
offset
;
char
p_text
[
i_textsize
+
1
];
char
p_text
[
i_textsize
+
1
];
i_total
=
vbi_print_page_region
(
&
p_page
,
p_text
,
i_textsize
,
i_total
=
vbi_print_page_region
(
&
p_page
,
p_text
,
i_textsize
,
"UTF-8"
,
0
,
0
,
0
,
i_first_row
,
p_page
.
columns
,
i_num_rows
);
"UTF-8"
,
0
,
0
,
0
,
i_first_row
,
p_page
.
columns
,
i_num_rows
);
p_text
[
i_total
]
=
'\0'
;
p_spu
->
p_region
->
psz_text
=
strdup
(
p_text
);
for
(
offset
=
1
;
offset
<
i_total
&&
isspace
(
p_text
[
i_total
-
offset
]
);
offset
++
)
p_text
[
i_total
-
offset
]
=
'\0'
;
i_total
-=
offset
;
offset
=
0
;
while
(
offset
<
i_total
&&
isspace
(
p_text
[
offset
]
)
)
offset
++
;
p_spu
->
p_region
->
psz_text
=
strdup
(
&
p_text
[
offset
]
);
#ifdef ZVBI_DEBUG
#ifdef ZVBI_DEBUG
msg_Info
(
p_dec
,
"page %x-%x(%d)
\n
%s"
,
p_page
.
pgno
,
p_page
.
subno
,
i_total
,
p_text
);
msg_Info
(
p_dec
,
"page %x-%x(%d)
\n
\"
%s
\"
"
,
p_page
.
pgno
,
p_page
.
subno
,
i_total
,
&
p_text
[
offset
]
);
#endif
#endif
}
}
else
else
...
...
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