[vlc-commits] epg: differentiate schedule eit from running info

Francois Cartegnie git at videolan.org
Tue Dec 20 21:42:47 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 20 14:01:37 2016 +0100| [60f64ac9c947407d222ec7515d7d2611ff3d0777] | committer: Francois Cartegnie

epg: differentiate schedule eit from running info

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

 include/vlc_epg.h            | 4 ++--
 modules/demux/mpeg/ts_psip.c | 5 ++++-
 modules/demux/mpeg/ts_si.c   | 4 ++--
 src/input/es_out.c           | 8 ++++----
 src/misc/epg.c               | 2 ++
 5 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/include/vlc_epg.h b/include/vlc_epg.h
index 5703c90..2ce8b60 100644
--- a/include/vlc_epg.h
+++ b/include/vlc_epg.h
@@ -45,12 +45,12 @@ typedef struct
 typedef struct
 {
     char            *psz_name;
-    const vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */
     uint32_t         i_id;       /* Unique identifier for this table / events (partial sets) */
     uint16_t         i_source_id;/* Channel / Program reference id this epg relates to */
-
     size_t            i_event;
     vlc_epg_event_t **pp_event;
+    bool             b_present;  /* Contains present/following or similar, and sets below */
+    const vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */
 } vlc_epg_t;
 
 /**
diff --git a/modules/demux/mpeg/ts_psip.c b/modules/demux/mpeg/ts_psip.c
index 3edbe95..748c0c6 100644
--- a/modules/demux/mpeg/ts_psip.c
+++ b/modules/demux/mpeg/ts_psip.c
@@ -463,6 +463,9 @@ static void ATSC_EIT_Callback( void *p_pid, dvbpsi_atsc_eit_t* p_eit )
         return;
     }
 
+    /* Use first table as present/following (not split like DVB) */
+    p_epg->b_present = (i_table_type == ATSC_TABLE_TYPE_EIT_0);
+
     if( !p_basectx->p_a65 && !(p_basectx->p_a65 = atsc_a65_handle_New( NULL )) )
         goto end;
 
@@ -486,7 +489,7 @@ static void ATSC_EIT_Callback( void *p_pid, dvbpsi_atsc_eit_t* p_eit )
     }
 
     /* Update epg current time from system time ( required for pruning ) */
-    if( i_current_event_start_time )
+    if( p_epg->b_present && i_current_event_start_time )
     {
         vlc_epg_SetCurrent( p_epg, i_current_event_start_time );
         ts_pat_t *p_pat = ts_pid_Get(&p_demux->p_sys->pids, 0)->u.p_pat;
diff --git a/modules/demux/mpeg/ts_si.c b/modules/demux/mpeg/ts_si.c
index fd2eed1..3f7aeb4 100644
--- a/modules/demux/mpeg/ts_si.c
+++ b/modules/demux/mpeg/ts_si.c
@@ -377,7 +377,6 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
     demux_sys_t        *p_sys = p_demux->p_sys;
     dvbpsi_eit_event_t *p_evt;
     vlc_epg_t *p_epg;
-    //bool b_current_following = (p_eit->i_table_id == 0x4e);
 
     msg_Dbg( p_demux, "EITCallBack called" );
     if( !p_eit->b_current_next )
@@ -594,7 +593,7 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
 
     if( p_epg->i_event > 0 )
     {
-        if( p_epg->p_current )
+        if( p_epg->b_present && p_epg->p_current )
         {
             ts_pat_t *p_pat = ts_pid_Get(&p_sys->pids, 0)->u.p_pat;
             ts_pmt_t *p_pmt = ts_pat_Get_pmt(p_pat, p_eit->i_extension);
@@ -604,6 +603,7 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
                 p_pmt->eit.i_event_length = p_epg->p_current->i_duration;
             }
         }
+        p_epg->b_present = (p_eit->i_table_id == 0x4e);
         es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_extension, p_epg );
     }
     vlc_epg_Delete( p_epg );
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 512cfd4..324b5fd 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1363,10 +1363,10 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
     input_SendEventMetaEpg( p_sys->p_input );
 
     /* Update now playing */
-    if( p_epg->p_current || p_epg->i_event == 0 )
+    if( p_epg->b_present && p_pgrm->p_meta &&
+       ( p_epg->p_current || p_epg->i_event == 0 ) )
     {
-        if( p_pgrm->p_meta )
-            vlc_meta_SetNowPlaying( p_pgrm->p_meta, NULL );
+        vlc_meta_SetNowPlaying( p_pgrm->p_meta, NULL );
     }
 
     vlc_mutex_lock( &p_item->lock );
@@ -1374,7 +1374,7 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
     {
         const vlc_epg_t *p_tmp = p_item->pp_epg[i];
 
-        if( p_tmp->i_source_id == p_pgrm->i_id )
+        if( p_tmp->b_present && p_tmp->i_source_id == p_pgrm->i_id )
         {
             const char *psz_name = ( p_tmp->p_current ) ? p_tmp->p_current->psz_name : NULL;
             if( !p_pgrm->p_meta )
diff --git a/src/misc/epg.c b/src/misc/epg.c
index bd88295..d06d344 100644
--- a/src/misc/epg.c
+++ b/src/misc/epg.c
@@ -87,6 +87,7 @@ static void vlc_epg_Init( vlc_epg_t *p_epg, uint32_t i_id, uint16_t i_source_id
     p_epg->i_source_id = i_source_id;
     p_epg->psz_name = NULL;
     p_epg->p_current = NULL;
+    p_epg->b_present = false;
     TAB_INIT( p_epg->i_event, p_epg->pp_event );
 }
 
@@ -270,6 +271,7 @@ vlc_epg_t * vlc_epg_Duplicate( const vlc_epg_t *p_src )
     if( p_epg )
     {
         p_epg->psz_name = ( p_src->psz_name ) ? strdup( p_src->psz_name ) : NULL;
+        p_epg->b_present = p_src->b_present;
         for( size_t i=0; i<p_src->i_event; i++ )
         {
             vlc_epg_event_t *p_dup = vlc_epg_event_Duplicate( p_src->pp_event[i] );



More information about the vlc-commits mailing list