[vlc-commits] skiptags: cosmetic, use switch

Rémi Denis-Courmont git at videolan.org
Sat Mar 31 17:02:15 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 31 15:37:52 2018 +0300| [e6a961fe72917947c207ee69f7b80745f403299a] | committer: Rémi Denis-Courmont

skiptags: cosmetic, use switch

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

 modules/stream_filter/skiptags.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/modules/stream_filter/skiptags.c b/modules/stream_filter/skiptags.c
index 2cf749a36c..d2d75b05fa 100644
--- a/modules/stream_filter/skiptags.c
+++ b/modules/stream_filter/skiptags.c
@@ -170,21 +170,26 @@ static int Seek(stream_t *stream, uint64_t offset)
 static int Control(stream_t *stream, int query, va_list args)
 {
     const struct skiptags_sys_t *sys = stream->p_sys;
+
     /* In principles, we should return the meta-data embedded in the skipped
      * tags in STREAM_GET_META. But the meta engine is devoted to that already.
      */
-    if( query == STREAM_GET_TAGS && sys->p_tags )
-    {
-        *va_arg( args, const block_t ** ) = sys->p_tags;
-        return VLC_SUCCESS;
-    }
-    else if(query == STREAM_GET_SIZE)
+    switch (query)
     {
-        uint64_t size;
-        int i_ret = vlc_stream_GetSize(stream->s, &size);
-        if(i_ret == VLC_SUCCESS)
-            *va_arg(args, uint64_t *) = size - sys->header_skip;
-        return i_ret;
+        case STREAM_GET_TAGS:
+            if (sys->p_tags == NULL)
+                break;
+            *va_arg(args, const block_t **) = sys->p_tags;
+            return VLC_SUCCESS;
+
+        case STREAM_GET_SIZE:
+        {
+            uint64_t size;
+            int ret = vlc_stream_GetSize(stream->s, &size);
+            if (ret == VLC_SUCCESS)
+                *va_arg(args, uint64_t *) = size - sys->header_skip;
+            return ret;
+        }
     }
 
     return vlc_stream_vaControl(stream->s, query, args);



More information about the vlc-commits mailing list