[vlc-commits] es_out_timeshift: use switch for CmdCleanControl

Francois Cartegnie git at videolan.org
Thu Aug 6 17:30:19 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 30 14:19:21 2015 +0200| [b455948738918e677481774112df32c018f0de4b] | committer: Francois Cartegnie

es_out_timeshift: use switch for CmdCleanControl

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

 src/input/es_out_timeshift.c |   34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index b1d1b75..7e4ec9c 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -1513,22 +1513,26 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
 }
 static void CmdCleanControl( ts_cmd_t *p_cmd )
 {
-    if( ( p_cmd->u.control.i_query == ES_OUT_SET_GROUP_META ||
-          p_cmd->u.control.i_query == ES_OUT_SET_META ) &&
-        p_cmd->u.control.u.int_meta.p_meta )
+    switch( p_cmd->u.control.i_query )
     {
-        vlc_meta_Delete( p_cmd->u.control.u.int_meta.p_meta );
-    }
-    else if( p_cmd->u.control.i_query == ES_OUT_SET_GROUP_EPG &&
-             p_cmd->u.control.u.int_epg.p_epg )
-    {
-        vlc_epg_Delete( p_cmd->u.control.u.int_epg.p_epg );
-    }
-    else if( p_cmd->u.control.i_query == ES_OUT_SET_ES_FMT &&
-             p_cmd->u.control.u.es_fmt.p_fmt )
-    {
-        es_format_Clean( p_cmd->u.control.u.es_fmt.p_fmt );
-        free( p_cmd->u.control.u.es_fmt.p_fmt );
+    case ES_OUT_SET_GROUP_META:
+    case ES_OUT_SET_META:
+        if( p_cmd->u.control.u.int_meta.p_meta )
+            vlc_meta_Delete( p_cmd->u.control.u.int_meta.p_meta );
+        break;
+    case ES_OUT_SET_GROUP_EPG:
+        if( p_cmd->u.control.u.int_epg.p_epg )
+            vlc_epg_Delete( p_cmd->u.control.u.int_epg.p_epg );
+        break;
+    case ES_OUT_SET_ES_FMT:
+        if( p_cmd->u.control.u.es_fmt.p_fmt )
+        {
+            es_format_Clean( p_cmd->u.control.u.es_fmt.p_fmt );
+            free( p_cmd->u.control.u.es_fmt.p_fmt );
+        }
+        // ft
+    default:
+        break;
     }
 }
 



More information about the vlc-commits mailing list