]> git.sesse.net Git - vlc/blobdiff - modules/demux/ts.c
xspf: simplify again.
[vlc] / modules / demux / ts.c
index be3cd884a980007dc30b15fc8253f5d96ce5ff4d..98e6721154bbd51494546af80d5563239ca0e6df 100644 (file)
@@ -843,7 +843,7 @@ static void Close( vlc_object_t *p_this )
     {
         vlc_value_t val;
         val.p_list = p_sys->p_programs_list;
-        var_Change( p_demux, "programs", VLC_VAR_FREELIST, &val, NULL );
+        var_FreeList( &val, NULL );
     }
 
     /* If in dump mode, then close the file */
@@ -2870,7 +2870,8 @@ static char *EITConvertToUTF8( const unsigned char *psz_instring,
     return psz_outstring;
 }
 
-static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
+static void EITCallBack( demux_t *p_demux,
+                         dvbpsi_eit_t *p_eit, bool b_current_following )
 {
     demux_sys_t        *p_sys = p_demux->p_sys;
     dvbpsi_eit_event_t *p_evt;
@@ -2987,7 +2988,7 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
     }
     if( p_epg->i_event > 0 )
     {
-        if( p_eit->i_service_id == p_sys->i_current_program )
+        if( p_eit->i_service_id == p_sys->i_current_program && b_current_following )
         {
             p_sys->i_dvb_length = 0;
             p_sys->i_dvb_start = 0;
@@ -3004,6 +3005,14 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
 
     dvbpsi_DeleteEIT( p_eit );
 }
+static void EITCallBackCurrentFollowing( demux_t *p_demux, dvbpsi_eit_t *p_eit )
+{
+    EITCallBack( p_demux, p_eit, true );
+}
+static void EITCallBackSchedule( demux_t *p_demux, dvbpsi_eit_t *p_eit )
+{
+    EITCallBack( p_demux, p_eit, false );
+}
 
 static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
                                  uint8_t  i_table_id, uint16_t i_extension )
@@ -3027,8 +3036,10 @@ static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
         msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
                  i_table_id, i_table_id, i_extension, i_extension );
 
-        dvbpsi_AttachEIT( h, i_table_id, i_extension,
-                          (dvbpsi_eit_callback)EITCallBack, p_demux );
+        dvbpsi_eit_callback cb = i_table_id == 0x4e ?
+                                    (dvbpsi_eit_callback)EITCallBackCurrentFollowing :
+                                    (dvbpsi_eit_callback)EITCallBackSchedule;
+        dvbpsi_AttachEIT( h, i_table_id, i_extension, cb, p_demux );
     }
 }
 #endif
@@ -3217,7 +3228,8 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
             ts_teletext_page_t *p_dst = &p_page[i_page++];
 
             p_dst->i_type = p_src->i_teletext_type;
-            p_dst->i_magazine = p_src->i_teletext_magazine_number ? : 8;
+            p_dst->i_magazine = p_src->i_teletext_magazine_number
+                ? p_src->i_teletext_magazine_number : 8;
             p_dst->i_page = p_src->i_teletext_page_number;
             memcpy( p_dst->p_iso639, p_src->i_iso6392_language_code, 3 );
         }
@@ -3250,7 +3262,8 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
                 break;
             }
             /* FIXME check if it is the right split */
-            p_dst->i_magazine = (p_src->i_composition_page_id >> 8) ? : 8;
+            p_dst->i_magazine = (p_src->i_composition_page_id >> 8)
+                ? (p_src->i_composition_page_id >> 8) : 8;
             p_dst->i_page = p_src->i_composition_page_id & 0xff;
             memcpy( p_dst->p_iso639, p_src->i_iso6392_language_code, 3 );
         }
@@ -3490,14 +3503,17 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
                 case 0x11: /*                 ...   on 4:3 AR monitor */
                 case 0x12: /*                 ...   on 16:9 AR monitor */
                 case 0x13: /*                 ...   on 2.21:1 AR monitor */
+                case 0x14: /*                 ...   for display on a high definition monitor */
                 case 0x20: /* DVB Subtitle (impaired) with no monitor AR critical */
                 case 0x21: /*                 ...   on 4:3 AR monitor */
                 case 0x22: /*                 ...   on 16:9 AR monitor */
                 case 0x23: /*                 ...   on 2.21:1 AR monitor */
+                case 0x24: /*                 ...   for display on a high definition monitor */
                     PMTSetupEsDvbSubtitle( p_demux, pid, p_es );
                     break;
                 default:
-                    msg_Err( p_demux, "Unrecognized DVB subtitle type" );
+                    msg_Err( p_demux, "Unrecognized DVB subtitle type (0x%x)",
+                             p_sub->p_subtitle[i].i_subtitling_type );
                     break;
                 }
             }
@@ -3625,7 +3641,7 @@ static void PMTSetupEsHDMV( demux_t *p_demux, ts_pid_t *pid,
 
     case 0x83: /* TrueHD AC3 */
         p_fmt->i_cat = AUDIO_ES;
-        p_fmt->i_codec = VLC_CODEC_MLP;
+        p_fmt->i_codec = VLC_CODEC_TRUEHD;
         break;
 
     case 0x84: /* E-AC3 */
@@ -3847,21 +3863,18 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
         }
         else if( p_dr->i_tag == 0x05 )
         {
-            if( p_dr->i_tag == 0x05 )
+            /* Registration Descriptor */
+            if( p_dr->i_length != 4 )
             {
-                /* Registration Descriptor */
-                if( p_dr->i_length != 4 )
-                {
-                    msg_Warn( p_demux, "invalid Registration Descriptor" );
-                }
-                else
+                msg_Warn( p_demux, "invalid Registration Descriptor" );
+            }
+            else
+            {
+                msg_Dbg( p_demux, " * descriptor : registration %4.4s", p_dr->p_data );
+                if( !memcmp( p_dr->p_data, "HDMV", 4 ) )
                 {
-                    msg_Dbg( p_demux, " * descriptor : registration %4.4s", p_dr->p_data );
-                    if( !memcmp( p_dr->p_data, "HDMV", 4 ) )
-                    {
-                        /* Blu-Ray */
-                        b_hdmv = true;
-                    }
+                    /* Blu-Ray */
+                    b_hdmv = true;
                 }
             }
         }