[vlc-commits] vlc_es: disambiguate teletext page/values

Francois Cartegnie git at videolan.org
Mon Jul 15 10:44:57 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 11 10:21:22 2019 +0200| [c8ada7fb48a25101f8e8ae3f8dfee3325c7a51e4] | committer: Francois Cartegnie

vlc_es: disambiguate teletext page/values

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c8ada7fb48a25101f8e8ae3f8dfee3325c7a51e4
---

 include/vlc_es.h            | 4 ++--
 modules/codec/telx.c        | 2 +-
 modules/codec/zvbi.c        | 2 +-
 modules/demux/mpeg/ts_psi.c | 2 +-
 src/input/player.c          | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index e80733eca3..6f604d6800 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -573,8 +573,8 @@ struct subs_format_t
     } dvb;
     struct
     {
-        int i_magazine;
-        int i_page;
+        uint8_t i_magazine; /* magazine value (3 bits), > 8 for any */
+        uint8_t i_page;     /* BCD packet address value (4+4 bits) */
     } teletext;
     struct
     {
diff --git a/modules/codec/telx.c b/modules/codec/telx.c
index 317f23c659..b0fe5f84fa 100644
--- a/modules/codec/telx.c
+++ b/modules/codec/telx.c
@@ -189,7 +189,7 @@ static int Open( vlc_object_t *p_this )
         p_sys->pi_active_national_set[i] = ppi_national_subsets[1];
 
     i_val = var_CreateGetInteger( p_dec, "telx-override-page" );
-    if( i_val == -1 && p_dec->fmt_in.subs.teletext.i_magazine != -1 &&
+    if( i_val == -1 && p_dec->fmt_in.subs.teletext.i_magazine < 9 &&
         ( p_dec->fmt_in.subs.teletext.i_magazine != 1 ||
           p_dec->fmt_in.subs.teletext.i_page != 0 ) ) /* ignore if TS demux wants page 100 (unlikely to be sub) */
     {
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 56e486439f..9b2ca44297 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -253,7 +253,7 @@ static int Open( vlc_object_t *p_this )
     var_AddCallback( p_dec, "vbi-page", RequestPage, p_sys );
 
     /* Check if the Teletext track has a known "initial page". */
-    if( p_sys->i_wanted_page == 100 && p_dec->fmt_in.subs.teletext.i_magazine != -1 )
+    if( p_sys->i_wanted_page == 100 && p_dec->fmt_in.subs.teletext.i_magazine < 9 )
     {
         p_sys->i_wanted_page = 100 * p_dec->fmt_in.subs.teletext.i_magazine +
                                vbi_bcd2dec( p_dec->fmt_in.subs.teletext.i_page );
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index e9fb6659d1..4cda520d17 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -856,7 +856,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_stream_t *p_pes,
 
     if( !p_sys->b_split_es || i_page <= 0 )
     {
-        p_fmt->subs.teletext.i_magazine = -1;
+        p_fmt->subs.teletext.i_magazine = 255;
         p_fmt->subs.teletext.i_page = 0;
         p_fmt->psz_description = strdup( vlc_gettext(ppsz_teletext_type[1]) );
 
diff --git a/src/input/player.c b/src/input/player.c
index 3d51666b5b..4d0e13c668 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -1802,7 +1802,7 @@ vlc_player_input_HandleEsEvent(struct vlc_player_input *input,
 
     if (ev->fmt->i_cat == SPU_ES && ev->fmt->i_codec == VLC_CODEC_TELETEXT
      && (ev->fmt->subs.teletext.i_magazine == 1
-      || ev->fmt->subs.teletext.i_magazine == -1))
+      || ev->fmt->subs.teletext.i_magazine > 8))
     {
         vlc_player_input_HandleTeletextMenu(input, ev);
         return;



More information about the vlc-commits mailing list