[vlc-commits] attachment: implement ACCESS_GET_SIZE

Rémi Denis-Courmont git at videolan.org
Fri Jul 24 15:21:55 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul 24 15:55:39 2015 +0300| [df3be99a4bf8e1a953f5261e1b23a893169a14be] | committer: Rémi Denis-Courmont

attachment: implement ACCESS_GET_SIZE

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

 modules/access/attachment.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/access/attachment.c b/modules/access/attachment.c
index 3ded985..1fda56b 100644
--- a/modules/access/attachment.c
+++ b/modules/access/attachment.c
@@ -122,28 +122,28 @@ static int Seek(access_t *access, uint64_t position)
 /* */
 static int Control(access_t *access, int query, va_list args)
 {
-    VLC_UNUSED(access);
+    input_attachment_t *a = (void *)access->p_sys;
+
     switch (query)
     {
-    /* */
     case ACCESS_CAN_SEEK:
     case ACCESS_CAN_FASTSEEK:
     case ACCESS_CAN_PAUSE:
-    case ACCESS_CAN_CONTROL_PACE: {
-        bool *b = va_arg(args, bool*);
-        *b = true;
-        return VLC_SUCCESS;
-    }
-    case ACCESS_GET_PTS_DELAY: {
-        int64_t *d = va_arg(args, int64_t *);
-        *d = DEFAULT_PTS_DELAY;
-        return VLC_SUCCESS;
-    }
+    case ACCESS_CAN_CONTROL_PACE:
+        *va_arg(args, bool *) = true;
+        break;
+    case ACCESS_GET_SIZE:
+        *va_arg(args, uint64_t *) = a->i_data;
+        break;
+    case ACCESS_GET_PTS_DELAY:
+        *va_arg(args, int64_t *) = DEFAULT_PTS_DELAY;
+        break;
     case ACCESS_SET_PAUSE_STATE:
         return VLC_SUCCESS;
 
     default:
         return VLC_EGENERIC;
     }
+    return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list