[vlc-devel] commit: Documented and 'constified' meta and epg in es_out. (Laurent Aimar )

git version control git at videolan.org
Sun Jul 19 18:11:55 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jul 19 17:54:04 2009 +0200| [a86267a44531de3182a4cedde4d3064562387d37] | committer: Laurent Aimar 

Documented and 'constified' meta and epg in es_out.

No functionnal changes.

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

 include/vlc_es_out.h         |    8 ++++----
 src/input/es_out.c           |    8 ++++----
 src/input/es_out_timeshift.c |   18 ++++++++++--------
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index 4739b41..2c9c3c3 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -65,10 +65,10 @@ enum es_out_query_e
 
     /* Allow preroll of data (data with dts/pts < i_pts for all ES will be decoded but not displayed */
     ES_OUT_SET_NEXT_DISPLAY_TIME,       /* arg1=int64_t i_pts(microsecond) */
-    /* Set meta data for group (dynamic) */
-    ES_OUT_SET_GROUP_META,  /* arg1=int i_group arg2=vlc_meta_t */
-    /* Set epg for group (dynamic) */
-    ES_OUT_SET_GROUP_EPG,   /* arg1=int i_group arg2=vlc_epg_t */
+    /* Set meta data for group (dynamic) (The vlc_meta_t is not modified nor released) */
+    ES_OUT_SET_GROUP_META,  /* arg1=int i_group arg2=const vlc_meta_t */
+    /* Set epg for group (dynamic) (The vlc_epg_t is not modified nor released) */
+    ES_OUT_SET_GROUP_EPG,   /* arg1=int i_group arg2=const vlc_epg_t */
     /* */
     ES_OUT_DEL_GROUP,       /* arg1=int i_group */
 
diff --git a/src/input/es_out.c b/src/input/es_out.c
index df8a692..31bc06c 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1153,7 +1153,7 @@ static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm )
     return psz;
 }
 
-static void EsOutProgramMeta( es_out_t *out, int i_group, vlc_meta_t *p_meta )
+static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_meta )
 {
     es_out_sys_t      *p_sys = out->p_sys;
     es_out_pgrm_t     *p_pgrm;
@@ -1289,7 +1289,7 @@ static void vlc_epg_Merge( vlc_epg_t *p_dst, const vlc_epg_t *p_src )
     }
 }
 
-static void EsOutProgramEpg( es_out_t *out, int i_group, vlc_epg_t *p_epg )
+static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg )
 {
     es_out_sys_t      *p_sys = out->p_sys;
     input_thread_t    *p_input = p_sys->p_input;
@@ -2380,7 +2380,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         case ES_OUT_SET_GROUP_META:
         {
             int i_group = (int)va_arg( args, int );
-            vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t * );
+            const vlc_meta_t *p_meta = va_arg( args, const vlc_meta_t * );
 
             EsOutProgramMeta( out, i_group, p_meta );
             return VLC_SUCCESS;
@@ -2388,7 +2388,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         case ES_OUT_SET_GROUP_EPG:
         {
             int i_group = (int)va_arg( args, int );
-            vlc_epg_t *p_epg = (vlc_epg_t*)va_arg( args, vlc_epg_t * );
+            const vlc_epg_t *p_epg = va_arg( args, const vlc_epg_t * );
 
             EsOutProgramEpg( out, i_group, p_epg );
             return VLC_SUCCESS;
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index a48d365..4e71c51 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -1315,10 +1315,10 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
     case ES_OUT_RESET_PCR:           /* no arg */
         break;
 
-    case ES_OUT_SET_GROUP_META:  /* arg1=int i_group arg2=vlc_meta_t* */
+    case ES_OUT_SET_GROUP_META:  /* arg1=int i_group arg2=const vlc_meta_t* */
     {
         p_cmd->control.int_meta.i_int = (int)va_arg( args, int );
-        vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t * );
+        const vlc_meta_t *p_meta = va_arg( args, const vlc_meta_t * );
 
         if( b_copy )
         {
@@ -1329,15 +1329,16 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
         }
         else
         {
-            p_cmd->control.int_meta.p_meta = p_meta;
+            /* The cast is only needed to avoid warning */
+            p_cmd->control.int_meta.p_meta = (vlc_meta_t*)p_meta;
         }
         break;
     }
 
-    case ES_OUT_SET_GROUP_EPG:   /* arg1=int i_group arg2=vlc_epg_t* */
+    case ES_OUT_SET_GROUP_EPG:   /* arg1=int i_group arg2=const vlc_epg_t* */
     {
         p_cmd->control.int_epg.i_int = (int)va_arg( args, int );
-        vlc_epg_t *p_epg = (vlc_epg_t*)va_arg( args, vlc_epg_t * );
+        const vlc_epg_t *p_epg = va_arg( args, const vlc_epg_t * );
 
         if( b_copy )
         {
@@ -1358,7 +1359,8 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
         }
         else
         {
-            p_cmd->control.int_epg.p_epg = p_epg;
+            /* The cast is only needed to avoid warning */
+            p_cmd->control.int_epg.p_epg = (vlc_epg_t*)p_epg;
         }
         break;
     }
@@ -1447,11 +1449,11 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
     case ES_OUT_RESET_PCR:           /* no arg */
         return es_out_Control( p_out, i_query );
 
-    case ES_OUT_SET_GROUP_META:  /* arg1=int i_group arg2=vlc_meta_t* */
+    case ES_OUT_SET_GROUP_META:  /* arg1=int i_group arg2=const vlc_meta_t* */
         return es_out_Control( p_out, i_query, p_cmd->control.int_meta.i_int,
                                                p_cmd->control.int_meta.p_meta );
 
-    case ES_OUT_SET_GROUP_EPG:   /* arg1=int i_group arg2=vlc_epg_t* */
+    case ES_OUT_SET_GROUP_EPG:   /* arg1=int i_group arg2=const vlc_epg_t* */
         return es_out_Control( p_out, i_query, p_cmd->control.int_epg.i_int,
                                                p_cmd->control.int_epg.p_epg );
 




More information about the vlc-devel mailing list