]> git.sesse.net Git - vlc/blobdiff - modules/access/mtp.c
avcodec: fix end-of-stream handling (fixes #8792) and factor code
[vlc] / modules / access / mtp.c
index c7ce997d40289e8f6eada33186da6e4fc8bb1b04..baf90c57a44cee5d13d6faf6f60b24732b1f84f1 100644 (file)
@@ -292,19 +292,11 @@ static int open_file( access_t *p_access, const char *path )
                         _( "VLC could not open the file \"%s\". (%m)" ), path );
         return -1;
     }
-
-#if defined( HAVE_FCNTL )
-    fcntl( fd, F_SETFD, fcntl( fd, F_GETFD ) | FD_CLOEXEC );
-
-    /* We'd rather use any available memory for reading ahead
-     * than for caching what we've already seen/heard */
-# if defined( F_RDAHEAD )
+#ifdef F_RDAHEAD
     fcntl( fd, F_RDAHEAD, 1 );
-# endif
-# if defined( F_NOCACHE )
-    fcntl( fd, F_NOCACHE, 1 );
-# endif
 #endif
-
+#ifdef F_NOCACHE
+    fcntl( fd, F_NOCACHE, 0 );
+#endif
     return fd;
 }