[vlc-commits] file: update size whenever it is requested

Rémi Denis-Courmont git at videolan.org
Sun Aug 25 11:44:29 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 25 12:44:17 2013 +0300| [522dbd1b96b85942b1e17fba229c66fe1e6d9ddb] | committer: Rémi Denis-Courmont

file: update size whenever it is requested

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

 modules/access/file.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/access/file.c b/modules/access/file.c
index dbd83ab..4fa58de 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -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:



More information about the vlc-commits mailing list