[vlc-commits] es_out: use only channel name for epg

Francois Cartegnie git at videolan.org
Wed Dec 28 11:14:08 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 27 19:25:30 2016 +0100| [cb15c171a9ccb81864388fb9520b0ca622f075c9] | committer: Francois Cartegnie

es_out: use only channel name for epg

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

 src/input/es_out.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 90a58e5..7f9a24d 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1189,6 +1189,21 @@ static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm )
     return psz;
 }
 
+static char *EsOutProgramGetProgramName( es_out_pgrm_t *p_pgrm )
+{
+    char *psz = NULL;
+    if( p_pgrm->p_meta && vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ) )
+    {
+        return strdup( vlc_meta_Get( p_pgrm->p_meta, vlc_meta_Title ) );
+    }
+    else
+    {
+        if( asprintf( &psz, "%s %d", _("Program"), p_pgrm->i_id ) == -1 )
+            return NULL;
+    }
+    return psz;
+}
+
 static char *EsInfoCategoryName( es_out_id_t* es )
 {
     char *psz_category;
@@ -1360,11 +1375,13 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
     vlc_epg_t epg;
 
     epg = *p_epg;
-    epg.psz_name = psz_cat;
+    epg.psz_name = EsOutProgramGetProgramName( p_pgrm );
 
-    input_item_SetEpg( p_item, &epg, p_epg->i_source_id == p_pgrm->i_id );
+    input_item_SetEpg( p_item, &epg, p_sys->p_pgrm && (p_epg->i_source_id == p_sys->p_pgrm->i_id) );
     input_SendEventMetaEpg( p_sys->p_input );
 
+    free( epg.psz_name );
+
     /* Update now playing */
     if( p_epg->b_present && p_pgrm->p_meta &&
        ( p_epg->p_current || p_epg->i_event == 0 ) )



More information about the vlc-commits mailing list