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
be6cfb05
Commit
be6cfb05
authored
Feb 05, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access_file: cosmetics
parent
28431c2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
modules/access/file.c
modules/access/file.c
+19
-21
No files found.
modules/access/file.c
View file @
be6cfb05
...
@@ -128,7 +128,6 @@ static int Open( vlc_object_t *p_this )
...
@@ -128,7 +128,6 @@ static int Open( vlc_object_t *p_this )
STANDARD_READ_ACCESS_INIT
;
STANDARD_READ_ACCESS_INIT
;
p_sys
->
i_nb_reads
=
0
;
p_sys
->
i_nb_reads
=
0
;
int
fd
=
p_sys
->
fd
=
-
1
;
if
(
!
strcasecmp
(
p_access
->
psz_access
,
"stream"
))
if
(
!
strcasecmp
(
p_access
->
psz_access
,
"stream"
))
{
{
...
@@ -144,38 +143,30 @@ static int Open( vlc_object_t *p_this )
...
@@ -144,38 +143,30 @@ static int Open( vlc_object_t *p_this )
/* Open file */
/* Open file */
msg_Dbg
(
p_access
,
"opening file `%s'"
,
p_access
->
psz_path
);
msg_Dbg
(
p_access
,
"opening file `%s'"
,
p_access
->
psz_path
);
int
fd
=
-
1
;
if
(
b_stdin
)
if
(
b_stdin
)
fd
=
dup
(
0
);
fd
=
dup
(
0
);
else
else
fd
=
open_file
(
p_access
,
p_access
->
psz_path
);
fd
=
open_file
(
p_access
,
p_access
->
psz_path
);
if
(
fd
==
-
1
)
goto
error
;
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
struct
stat
st
;
struct
stat
st
;
while
(
fd
!=
-
1
)
{
if
(
fstat
(
fd
,
&
st
))
if
(
fstat
(
fd
,
&
st
))
msg_Err
(
p_access
,
"fstat(%d): %m"
,
fd
);
{
else
msg_Err
(
p_access
,
"failed to read (%m)"
);
if
(
S_ISDIR
(
st
.
st_mode
))
goto
error
;
/* The directory plugin takes care of that */
msg_Dbg
(
p_access
,
"file is a directory, aborting"
);
else
break
;
// success
close
(
fd
);
fd
=
-
1
;
}
}
#endif
/* Directories can be opened and read from, but only readdir() knows
* how to parse the data. The directory plugin will do it. */
if
(
fd
==
-
1
)
if
(
S_ISDIR
(
st
.
st_mode
)
)
{
{
free
(
p_sys
);
msg_Dbg
(
p_access
,
"ignoring directory"
);
return
VLC_EGENERIC
;
goto
error
;
}
}
p_sys
->
fd
=
fd
;
#ifdef HAVE_SYS_STAT_H
p_access
->
info
.
i_size
=
st
.
st_size
;
p_access
->
info
.
i_size
=
st
.
st_size
;
if
(
!
S_ISREG
(
st
.
st_mode
))
if
(
!
S_ISREG
(
st
.
st_mode
))
p_sys
->
b_seekable
=
false
;
p_sys
->
b_seekable
=
false
;
...
@@ -184,7 +175,14 @@ static int Open( vlc_object_t *p_this )
...
@@ -184,7 +175,14 @@ static int Open( vlc_object_t *p_this )
# warning File size not known!
# warning File size not known!
#endif
#endif
p_sys
->
fd
=
fd
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
if
(
fd
!=
-
1
)
close
(
fd
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -226,7 +224,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
...
@@ -226,7 +224,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
break
;
break
;
default:
default:
msg_Err
(
p_access
,
"
read faile
d (%m)"
);
msg_Err
(
p_access
,
"
failed to rea
d (%m)"
);
intf_UserFatal
(
p_access
,
false
,
_
(
"File reading failed"
),
intf_UserFatal
(
p_access
,
false
,
_
(
"File reading failed"
),
_
(
"VLC could not read the file."
));
_
(
"VLC could not read the file."
));
p_access
->
info
.
b_eof
=
true
;
p_access
->
info
.
b_eof
=
true
;
...
...
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