Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
a25aa2c0
Commit
a25aa2c0
authored
Sep 09, 2014
by
Rafaël Carré
Browse files
DVB: strip character emphasis control codes
Fix display of BSkyB program names as 0x86Foobar0x87
parent
9ef8db17
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/demux/dvb-text.h
View file @
a25aa2c0
...
...
@@ -94,6 +94,7 @@ static char *vlc_from_EIT (const void *buf, size_t length)
EnsureUTF8
(
out
);
}
length
=
strlen
(
out
);
/* Convert control codes */
for
(
char
*
p
=
strchr
(
out
,
'\xC2'
);
p
;
p
=
strchr
(
p
+
1
,
'\xC2'
))
{
...
...
@@ -104,6 +105,16 @@ static char *vlc_from_EIT (const void *buf, size_t length)
* 0x8B-0x9F are unspecified. */
if
(
p
[
1
]
==
'\x8A'
)
memcpy
(
p
,
"
\r\n
"
,
2
);
/* Strip character emphasis */
if
(
p
[
1
]
==
'\x86'
||
p
[
1
]
==
'\x87'
)
{
const
size_t
n
=
p
-
out
;
memmove
(
p
,
p
+
2
,
length
-
n
);
length
-=
2
;
out
[
length
]
=
'\0'
;
if
(
length
==
n
)
break
;
}
}
/* Private use area */
...
...
@@ -114,6 +125,16 @@ static char *vlc_from_EIT (const void *buf, size_t length)
continue
;
if
(
p
[
2
]
==
'\x8A'
)
memcpy
(
p
,
"
\r\r\n
"
,
3
);
/* we need three bytes, so to CRs ;) */
/* Strip character emphasis */
if
(
p
[
2
]
==
'\x86'
||
p
[
2
]
==
'\x87'
)
{
const
size_t
n
=
p
-
out
;
memmove
(
p
,
p
+
3
,
length
-
n
);
length
-=
3
;
out
[
length
]
=
'\0'
;
if
(
length
==
n
)
break
;
}
}
return
out
;
...
...
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