]> git.sesse.net Git - vlc/commitdiff
file: update size whenever it is requested
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 25 Aug 2013 09:44:17 +0000 (12:44 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 25 Aug 2013 09:44:17 +0000 (12:44 +0300)
modules/access/file.c

index dbd83abe0a964cf236b831ec7531cc8496115c92..4fa58dec9ae87f14325ccfb05a0cae0f3c469f62 100644 (file)
@@ -389,8 +389,14 @@ static int FileControl( access_t *p_access, int i_query, va_list args )
             break;
 
         case ACCESS_GET_SIZE:
+        {
+            struct stat st;
+
+            if (fstat (p_sys->fd, &st) == 0)
+                p_sys->size = st.st_size;
             *va_arg( args, uint64_t * ) = p_sys->size;
             break;
+        }
 
         /* */
         case ACCESS_GET_PTS_DELAY: