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
f4941313
Commit
f4941313
authored
Feb 18, 2006
by
dionoea
Browse files
use EnsureUTF8 on output string
parent
c4d8e42c
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/video_filter/rss.c
View file @
f4941313
/*****************************************************************************
* rss.c : rss feed display video plugin for vlc
*****************************************************************************
* Copyright (C) 2003-200
5
the VideoLAN team
* Copyright (C) 2003-200
6
the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea
@
videolan
.
org>
* Authors: Antoine Cellerier <dionoea
-at-
videolan
-dot-
org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -355,14 +355,38 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
return
NULL
;
}
/* Generate the string that will be displayed. This string is supposed to
be p_sys->i_length characters long. */
i_item
=
p_sys
->
i_cur_item
;
i_feed
=
p_sys
->
i_cur_feed
;
snprintf
(
p_sys
->
psz_marquee
,
p_sys
->
i_length
,
"%s : %s"
,
p_sys
->
p_feeds
[
i_feed
].
psz_title
,
p_sys
->
p_feeds
[
i_feed
].
p_items
[
i_item
].
psz_title
+
p_sys
->
i_cur_char
);
snprintf
(
p_sys
->
psz_marquee
,
p_sys
->
i_length
,
"%s : %s"
,
p_sys
->
p_feeds
[
i_feed
].
psz_title
,
p_sys
->
p_feeds
[
i_feed
].
p_items
[
i_item
].
psz_title
+
p_sys
->
i_cur_char
);
while
(
strlen
(
p_sys
->
psz_marquee
)
<
(
unsigned
int
)
p_sys
->
i_length
)
{
i_item
++
;
if
(
i_item
==
p_sys
->
p_feeds
[
i_feed
].
i_items
)
break
;
snprintf
(
strchr
(
p_sys
->
psz_marquee
,
0
),
p_sys
->
i_length
-
strlen
(
p_sys
->
psz_marquee
),
" - %s"
,
p_sys
->
p_feeds
[
i_feed
].
p_items
[
i_item
].
psz_title
);
snprintf
(
strchr
(
p_sys
->
psz_marquee
,
0
),
p_sys
->
i_length
-
strlen
(
p_sys
->
psz_marquee
),
" - %s"
,
p_sys
->
p_feeds
[
i_feed
].
p_items
[
i_item
].
psz_title
);
}
/* Calls to snprintf might split multibyte UTF8 chars ...
* which freetype doesn't like. */
{
char
*
a
=
strdup
(
p_sys
->
psz_marquee
);
char
*
a2
=
a
;
char
*
b
=
p_sys
->
psz_marquee
;
EnsureUTF8
(
p_sys
->
psz_marquee
);
/* we want to use ' ' instead of '?' for erroneous chars */
while
(
*
b
!=
'\0'
)
{
if
(
*
b
!=
*
a
)
*
b
=
' '
;
b
++
;
a
++
;
}
free
(
a2
);
}
p_spu
->
p_region
->
psz_text
=
strdup
(
p_sys
->
psz_marquee
);
...
...
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