Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
a059cf56
Commit
a059cf56
authored
Dec 28, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file: use vlc_strerror()
This fixes "%m" in error dialogs on non-GNU platforms.
parent
9ff28119
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
15 deletions
+24
-15
modules/access/file.c
modules/access/file.c
+9
-6
modules/access_output/file.c
modules/access_output/file.c
+7
-4
modules/audio_output/file.c
modules/audio_output/file.c
+8
-5
No files found.
modules/access/file.c
View file @
a059cf56
...
...
@@ -172,9 +172,11 @@ int FileOpen( vlc_object_t *p_this )
fd
=
vlc_open
(
path
,
O_RDONLY
|
O_NONBLOCK
);
if
(
fd
==
-
1
)
{
msg_Err
(
p_access
,
"cannot open file %s (%m)"
,
path
);
msg_Err
(
p_access
,
"cannot open file %s (%s)"
,
path
,
vlc_strerror_c
(
errno
));
dialog_Fatal
(
p_access
,
_
(
"File reading failed"
),
_
(
"VLC could not open the file
\"
%s
\"
(%m)."
),
path
);
_
(
"VLC could not open the file
\"
%s
\"
(%s)."
),
path
,
vlc_strerror
(
errno
));
}
}
if
(
fd
==
-
1
)
...
...
@@ -183,7 +185,7 @@ int FileOpen( vlc_object_t *p_this )
struct
stat
st
;
if
(
fstat
(
fd
,
&
st
))
{
msg_Err
(
p_access
,
"
failed to read (%m)"
);
msg_Err
(
p_access
,
"
read error: %s"
,
vlc_strerror_c
(
errno
)
);
goto
error
;
}
...
...
@@ -295,9 +297,10 @@ static ssize_t FileRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
return
-
1
;
}
msg_Err
(
p_access
,
"read error: %
m"
);
msg_Err
(
p_access
,
"read error: %
s"
,
vlc_strerror_c
(
errno
)
);
dialog_Fatal
(
p_access
,
_
(
"File reading failed"
),
_
(
"VLC could not read the file (%m)."
));
_
(
"VLC could not read the file (%s)."
),
vlc_strerror
(
errno
));
val
=
0
;
}
...
...
@@ -348,7 +351,7 @@ static ssize_t StreamRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
case
EAGAIN
:
return
-
1
;
}
msg_Err
(
p_access
,
"read error: %
m"
);
msg_Err
(
p_access
,
"read error: %
s"
,
vlc_strerror_c
(
errno
)
);
val
=
0
;
}
...
...
modules/access_output/file.c
View file @
a059cf56
...
...
@@ -149,7 +149,8 @@ static int Open( vlc_object_t *p_this )
fd
=
vlc_dup
(
fd
);
if
(
fd
==
-
1
)
{
msg_Err
(
p_access
,
"cannot use file descriptor: %m"
);
msg_Err
(
p_access
,
"cannot use file descriptor: %s"
,
vlc_strerror_c
(
errno
));
return
VLC_EGENERIC
;
}
}
...
...
@@ -162,7 +163,8 @@ static int Open( vlc_object_t *p_this )
fd
=
vlc_dup
(
STDOUT_FILENO
);
if
(
fd
==
-
1
)
{
msg_Err
(
p_access
,
"cannot use standard output: %m"
);
msg_Err
(
p_access
,
"cannot use standard output: %s"
,
vlc_strerror_c
(
errno
));
return
VLC_EGENERIC
;
}
msg_Dbg
(
p_access
,
"using stdout"
);
...
...
@@ -194,7 +196,8 @@ static int Open( vlc_object_t *p_this )
if
(
fd
!=
-
1
)
break
;
if
(
fd
==
-
1
)
msg_Err
(
p_access
,
"cannot create %s: %m"
,
path
);
msg_Err
(
p_access
,
"cannot create %s: %s"
,
path
,
vlc_strerror_c
(
errno
));
if
(
overwrite
||
errno
!=
EEXIST
)
break
;
flags
&=
~
O_EXCL
;
...
...
@@ -293,7 +296,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
if
(
errno
==
EINTR
)
continue
;
block_ChainRelease
(
p_buffer
);
msg_Err
(
p_access
,
"cannot write: %
m"
);
msg_Err
(
p_access
,
"cannot write: %
s"
,
vlc_strerror_c
(
errno
)
);
return
-
1
;
}
...
...
modules/audio_output/file.c
View file @
a059cf56
...
...
@@ -30,6 +30,9 @@
# include "config.h"
#endif
#include <stdio.h>
#include <errno.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
...
...
@@ -254,7 +257,7 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
if
(
fwrite
(
wh
,
sizeof
(
WAVEHEADER
),
1
,
p_aout
->
sys
->
p_file
)
!=
1
)
{
msg_Err
(
p_aout
,
"write error
(%m)"
);
msg_Err
(
p_aout
,
"write error
: %s"
,
vlc_strerror_c
(
errno
)
);
}
}
...
...
@@ -277,7 +280,7 @@ static void Stop( audio_output_t *p_aout )
/* Write Wave Header */
if
(
fseek
(
p_aout
->
sys
->
p_file
,
0
,
SEEK_SET
)
)
{
msg_Err
(
p_aout
,
"seek error
(%m)"
);
msg_Err
(
p_aout
,
"seek error
: %s"
,
vlc_strerror_c
(
errno
)
);
}
/* Header -> little endian format */
...
...
@@ -289,7 +292,7 @@ static void Stop( audio_output_t *p_aout )
if
(
fwrite
(
&
p_aout
->
sys
->
waveh
,
sizeof
(
WAVEHEADER
),
1
,
p_aout
->
sys
->
p_file
)
!=
1
)
{
msg_Err
(
p_aout
,
"write error
(%m)"
);
msg_Err
(
p_aout
,
"write error
: %s"
,
vlc_strerror_c
(
errno
)
);
}
}
...
...
@@ -306,7 +309,7 @@ static void Play( audio_output_t * p_aout, block_t *p_buffer )
if
(
fwrite
(
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
,
1
,
p_aout
->
sys
->
p_file
)
!=
1
)
{
msg_Err
(
p_aout
,
"write error
(%m)"
);
msg_Err
(
p_aout
,
"write error
: %s"
,
vlc_strerror_c
(
errno
)
);
}
if
(
p_aout
->
sys
->
b_add_wav_header
)
...
...
@@ -321,7 +324,7 @@ static void Play( audio_output_t * p_aout, block_t *p_buffer )
static
void
Flush
(
audio_output_t
*
aout
,
bool
wait
)
{
if
(
fflush
(
aout
->
sys
->
p_file
)
)
msg_Err
(
aout
,
"flush error
(%m)"
);
msg_Err
(
aout
,
"flush error
: %s"
,
vlc_strerror_c
(
errno
)
);
(
void
)
wait
;
}
...
...
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