[vlc-devel] commit: Set EPG default charset to ISO6937 as required by ETSI EN 300 468 Annex A ( Marian Ďurkovič )
git version control
git at videolan.org
Fri Sep 11 08:41:15 CEST 2009
vlc | branch: 1.0-bugfix | Marian Ďurkovič <md at bts.sk> | Thu Sep 10 08:54:33 2009 +0200| [b84c95305e0254d462c40e819492104865ebe5b9] | committer: Marian Ďurkovič
Set EPG default charset to ISO6937 as required by ETSI EN 300 468 Annex A
Also provide workarounds for some broadcasters which ignore this standard.
(cherry picked from commit 6217711a41045bbe5a38c6ef1481f806f60bc274)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b84c95305e0254d462c40e819492104865ebe5b9
---
modules/demux/ts.c | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 24be427..f2e76eb 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -374,6 +374,8 @@ struct demux_sys_t
bool b_start_record;
};
+static int i_broken_epg;
+
static int Demux ( demux_t *p_demux );
static int DemuxFile( demux_t *p_demux );
static int Control( demux_t *p_demux, int i_query, va_list args );
@@ -2587,9 +2589,17 @@ static char *EITConvertToUTF8( const unsigned char *psz_instring,
if( i_length < 1 ) return NULL;
if( psz_instring[0] >= 0x20 )
{
- psz_encoding = "ISO_8859-1";
- /* According to the specification, this should be ISO6937,
- * but it seems Latin-1 is used instead. */
+ /* According to ETSI EN 300 468 Annex A, this should be ISO6937,
+ * but some broadcasters use different charset... */
+ if ( i_broken_epg == 1 )
+ {
+ psz_encoding = "ISO_8859-1";
+ }
+ else
+ {
+ psz_encoding = "ISO_6937";
+ }
+
offset = 0;
}
else switch( psz_instring[0] )
@@ -2723,6 +2733,8 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
p_sdt->i_ts_id, p_sdt->i_version, p_sdt->b_current_next,
p_sdt->i_network_id );
+ i_broken_epg = 0;
+
for( p_srv = p_sdt->p_first_service; p_srv; p_srv = p_srv->p_next )
{
vlc_meta_t *p_meta;
@@ -2768,6 +2780,17 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
char *str1 = NULL;
char *str2 = NULL;
+ /* Workarounds for broadcasters with broken EPG */
+
+ if ( p_sdt->i_network_id == 133 )
+ i_broken_epg = 1; /* SKY DE & BetaDigital use ISO8859-1 */
+
+ if ( !strncmp(pD->i_service_provider_name, "CSAT",
+ pD->i_service_provider_name_length) )
+ i_broken_epg = 1; /* CanalSat FR uses ISO8859-1 */
+
+ /* FIXME: Digital+ ES also uses ISO8859-1 */
+
str1 = EITConvertToUTF8(pD->i_service_provider_name,
pD->i_service_provider_name_length);
str2 = EITConvertToUTF8(pD->i_service_name,
More information about the vlc-devel
mailing list