]> git.sesse.net Git - vlc/blobdiff - modules/demux/ts.c
httplive: Adjust conditions for playlist reloading
[vlc] / modules / demux / ts.c
index c9a6dd9e5ae60872c32794700098cfeaa41be050..f6c6fefd1db4b287b20dd6437538029c84b39220 100644 (file)
@@ -1019,6 +1019,7 @@ static int Demux( demux_t *p_demux )
                    p_sys->i_ts_read * p_sys->i_packet_size );
     }
 
+    demux_UpdateTitleFromStream( p_demux );
     return 1;
 }
 
@@ -1189,6 +1190,25 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
     }
 
+    case DEMUX_GET_TITLE_INFO:
+    {
+        struct input_title_t ***v = va_arg( args, struct input_title_t*** );
+        int *c = va_arg( args, int * );
+
+        *va_arg( args, int* ) = 0; /* Title offset */
+        *va_arg( args, int* ) = 0; /* Chapter offset */
+        return stream_Control( p_demux->s, STREAM_GET_TITLE_INFO, v, c );
+    }
+
+    case DEMUX_SET_TITLE:
+        return stream_vaControl( p_demux->s, STREAM_SET_TITLE, args );
+
+    case DEMUX_SET_SEEKPOINT:
+        return stream_vaControl( p_demux->s, STREAM_SET_SEEKPOINT, args );
+
+    case DEMUX_GET_META:
+        return stream_vaControl( p_demux->s, STREAM_GET_META, args );
+
     case DEMUX_CAN_RECORD:
         pb_bool = (bool*)va_arg( args, bool * );
         *pb_bool = true;
@@ -1203,7 +1223,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
 
     case DEMUX_GET_SIGNAL:
-        return stream_Control( p_demux->s, STREAM_GET_SIGNAL, args );
+        return stream_vaControl( p_demux->s, STREAM_GET_SIGNAL, args );
 
     default:
         return VLC_EGENERIC;
@@ -1220,6 +1240,7 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
     char *psz = psz_dup;
     int  i_pid;
     int  i_number;
+    ts_prg_psi_t *prg = NULL;
 
     if( !psz_dup )
         return VLC_ENOMEM;
@@ -1236,7 +1257,6 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
 
     /* */
     ts_pid_t *pmt = &p_sys->pid[i_pid];
-    ts_prg_psi_t *prg;
 
     msg_Dbg( p_demux, "user pmt specified (pid=%d,number=%d)", i_pid, i_number );
     PIDInit( pmt, true, NULL );
@@ -2001,7 +2021,7 @@ static int Seek( demux_t *p_demux, double f_percent )
     mtime_t i_target_pcr = (p_sys->i_last_pcr - p_sys->i_first_pcr) * f_percent + p_sys->i_first_pcr;
 
     int64_t i_head_pos = 0;
-    int64_t i_tail_pos = stream_Size( p_demux->s );
+    int64_t i_tail_pos;
     {
         mtime_t i_adjust = 0;
         int i;
@@ -3507,7 +3527,8 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
 
             /* */
             const ts_teletext_page_t *p = &p_page[i];
-            p_es->fmt.i_priority = (p->i_type == 0x02 || p->i_type == 0x05) ? 0 : -1;
+            p_es->fmt.i_priority = (p->i_type == 0x02 || p->i_type == 0x05) ?
+                      ES_PRIORITY_SELECTABLE_MIN : ES_PRIORITY_NOT_DEFAULTABLE;
             p_es->fmt.psz_language = strndup( p->p_iso639, 3 );
             p_es->fmt.psz_description = strdup(vlc_gettext(ppsz_teletext_type[p->i_type]));
             p_es->fmt.subs.teletext.i_magazine = p->i_magazine;
@@ -3902,7 +3923,7 @@ static void PMTParseEsIso639( demux_t *p_demux, ts_pid_t *pid,
     int type = p_decoded->code[0].i_audio_type;
     pid->es->fmt.psz_description = GetAudioTypeDesc(p_demux, type);
     if (type == 0)
-        pid->es->fmt.i_priority = 1; // prioritize normal audio tracks
+        pid->es->fmt.i_priority = ES_PRIORITY_SELECTABLE_MIN + 1; // prioritize normal audio tracks
 
     pid->es->fmt.i_extra_languages = p_decoded->i_code_count-1;
     if( pid->es->fmt.i_extra_languages > 0 )
@@ -4025,7 +4046,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
             else
             {
                 msg_Dbg( p_demux, " * descriptor : registration %4.4s", p_dr->p_data );
-                if( !memcmp( p_dr->p_data, "HDMV", 4 ) )
+                if( !memcmp( p_dr->p_data, "HDMV", 4 ) || !memcmp( p_dr->p_data, "HDPR", 4 ) )
                     b_hdmv = true; /* Blu-Ray */
             }
             break;