[vlc-devel] commit: zvbi: Added a table with language -> zvbi default_region mappings. Far from perfect, but will solve some cases. (Derk-Jan Hartman )
git version control
git at videolan.org
Thu Sep 11 13:33:52 CEST 2008
vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Sep 11 13:34:09 2008 +0200| [718739e91a61aab6f95f264bdc5635eaa1caeb5c] | committer: Derk-Jan Hartman
zvbi: Added a table with language -> zvbi default_region mappings. Far from perfect, but will solve some cases.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=718739e91a61aab6f95f264bdc5635eaa1caeb5c
---
modules/codec/zvbi.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 9405834..8218fe6 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -102,6 +102,27 @@ vlc_module_end();
// #define ZVBI_DEBUG
+//Guessing table for missing "default region triplet"
+static const int pi_default_triplet[] = {
+ 0, 0, // slo cze
+ 8, // pol
+ 24,24,24,24, //ssc scr slv rum
+ 32,32,32,32,32, //est lit rus bul ukr
+ 48,48, //gre ell
+ 64, //ara
+ 88, //heb
+ 16 }; //default
+static const char *const ppsz_default_triplet[] = {
+ "slo", "cze",
+ "pol",
+ "ssc", "scr", "slv", "rum",
+ "est", "lit", "rus", "bul", "ukr",
+ "gre", "ell",
+ "ara",
+ "heb",
+ NULL
+};
+
typedef enum {
DATA_UNIT_EBU_TELETEXT_NON_SUBTITLE = 0x02,
DATA_UNIT_EBU_TELETEXT_SUBTITLE = 0x03,
@@ -187,6 +208,19 @@ static int Open( vlc_object_t *p_this )
return VLC_ENOMEM;
}
+ /* Some broadcasters in countries with level 1 and level 1.5 still not send a G0 to do
+ * matches against table 32 of ETSI 300 706. We try to do some best effort guessing
+ * This is not perfect, but might handle some cases where we know the vbi language
+ * is known. It would be better if people started sending G0 */
+ for( int i = 0; ppsz_default_triplet[i] != NULL; i++ )
+ {
+ if( p_dec->fmt_in.psz_language && !strcmp( p_dec->fmt_in.psz_language, ppsz_default_triplet[i] ) )
+ {
+ vbi_teletext_set_default_region( p_sys->p_vbi_dec, pi_default_triplet[i]);
+ msg_Dbg( p_dec, "overwriting default zvbi region: %d", pi_default_triplet[i] );
+ }
+ }
+
vbi_event_handler_register( p_sys->p_vbi_dec, VBI_EVENT_TTX_PAGE |
VBI_EVENT_CAPTION | VBI_EVENT_NETWORK |
VBI_EVENT_ASPECT | VBI_EVENT_PROG_INFO,
More information about the vlc-devel
mailing list