]> git.sesse.net Git - vlc/commitdiff
zvbi: Use the "initial page" as signaled by the TS demuxer.
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 6 Sep 2008 12:56:08 +0000 (14:56 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 6 Sep 2008 13:25:27 +0000 (15:25 +0200)
This way the TS demux can create multiple tracks that will take you straight to the subtitles, program listings etc.

modules/codec/zvbi.c

index f4de0fd9aa5f04a8af243026e0c082c9993cf711..9405834cb9208d1fe8f62f51e3c90f561b5f270d 100644 (file)
@@ -197,6 +197,16 @@ 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.dvb.i_id != -1 )
+    {
+        int i_wanted_magazine = p_dec->fmt_in.subs.dvb.i_id >> 16;
+        if( i_wanted_magazine == 0 )
+            i_wanted_magazine = 8;
+        p_sys->i_wanted_page = vbi_bcd2dec(p_dec->fmt_in.subs.dvb.i_id & 0xff);
+        p_sys->i_wanted_page += 100*i_wanted_magazine;
+    }
+
     p_sys->b_opaque = var_CreateGetBool( p_dec, "vbi-opaque" );
     var_AddCallback( p_dec, "vbi-opaque", Opaque, p_sys );