]> git.sesse.net Git - vlc/commitdiff
Don't bother seeking when using mmap
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 26 Nov 2007 21:02:27 +0000 (21:02 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 26 Nov 2007 21:02:27 +0000 (21:02 +0000)
modules/access/file.c

index 616f31dfe440bfcc3474e3e050d92a5ae38cc235..ccaf3e8b679f6e373a029626e1be4aa293c06e80 100644 (file)
@@ -434,8 +434,10 @@ static int Seek (access_t *p_access, int64_t i_pos)
     p_access->info.i_pos = i_pos;
     p_access->info.b_eof = VLC_FALSE;
 
-    /* Determine which file we need to access */
-    lseek (p_access->p_sys->fd, i_pos, SEEK_SET);
+#ifdef HAVE_MMAP
+    if (p_access->pf_block == NULL)
+        lseek (p_access->p_sys->fd, i_pos, SEEK_SET);
+#endif
     return VLC_SUCCESS;
 }