Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
54ce5996
Commit
54ce5996
authored
Sep 05, 2011
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file: fix file/network caching detection for windows
Untested
parent
42b85a3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
modules/access/file.c
modules/access/file.c
+18
-6
No files found.
modules/access/file.c
View file @
54ce5996
...
@@ -71,8 +71,6 @@
...
@@ -71,8 +71,6 @@
# undef lseek
# undef lseek
# endif
# endif
# define lseek _lseeki64
# define lseek _lseeki64
#elif defined( UNDER_CE )
# define PathIsNetworkPathW(wpath) (! wcsncmp(wpath, L"\\\\", 2))
#endif
#endif
#include <vlc_fs.h>
#include <vlc_fs.h>
...
@@ -88,6 +86,7 @@ struct access_sys_t
...
@@ -88,6 +86,7 @@ struct access_sys_t
bool
b_pace_control
;
bool
b_pace_control
;
};
};
#ifndef WIN32
static
bool
IsRemote
(
int
fd
)
static
bool
IsRemote
(
int
fd
)
{
{
#if defined (HAVE_FSTATVFS) && defined (MNT_LOCAL)
#if defined (HAVE_FSTATVFS) && defined (MNT_LOCAL)
...
@@ -122,6 +121,22 @@ static bool IsRemote (int fd)
...
@@ -122,6 +121,22 @@ static bool IsRemote (int fd)
#endif
#endif
}
}
# define IsRemote(fd,path) IsRemote(fd)
#else
/* WIN32 */
static
bool
IsRemote
(
const
char
*
path
)
{
# ifndef UNDER_CE
wchar_t
*
wpath
=
ToWide
(
path
);
bool
is_remote
=
(
wpath
!=
NULL
&&
PathIsNetworkPathW
(
wpath
));
free
(
wpath
);
return
is_remote
;
# else
return
(
!
strncmp
(
path
,
"
\\\\
"
,
2
));
# endif
}
# define IsRemote(fd,path) IsRemote(path)
#endif
#ifndef HAVE_POSIX_FADVISE
#ifndef HAVE_POSIX_FADVISE
# define posix_fadvise(fd, off, len, adv)
# define posix_fadvise(fd, off, len, adv)
...
@@ -133,9 +148,6 @@ static bool IsRemote (int fd)
...
@@ -133,9 +148,6 @@ static bool IsRemote (int fd)
int
FileOpen
(
vlc_object_t
*
p_this
)
int
FileOpen
(
vlc_object_t
*
p_this
)
{
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_t
*
p_access
=
(
access_t
*
)
p_this
;
#ifdef WIN32
bool
is_remote
=
false
;
#endif
/* Open file */
/* Open file */
int
fd
=
-
1
;
int
fd
=
-
1
;
...
@@ -365,7 +377,7 @@ int FileControl( access_t *p_access, int i_query, va_list args )
...
@@ -365,7 +377,7 @@ int FileControl( access_t *p_access, int i_query, va_list args )
/* */
/* */
case
ACCESS_GET_PTS_DELAY
:
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
IsRemote
(
p_sys
->
fd
))
if
(
IsRemote
(
p_sys
->
fd
,
p_access
->
psz_filepath
))
*
pi_64
=
var_InheritInteger
(
p_access
,
"network-caching"
);
*
pi_64
=
var_InheritInteger
(
p_access
,
"network-caching"
);
else
else
*
pi_64
=
var_InheritInteger
(
p_access
,
"file-caching"
);
*
pi_64
=
var_InheritInteger
(
p_access
,
"file-caching"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment