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
cfc2e718
Commit
cfc2e718
authored
Dec 28, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSS: use vlc_strerror_c()
parent
d0dd8a45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
modules/access/oss.c
modules/access/oss.c
+12
-6
modules/audio_output/oss.c
modules/audio_output/oss.c
+16
-10
No files found.
modules/access/oss.c
View file @
cfc2e718
...
...
@@ -339,7 +339,8 @@ static int OpenAudioDevOss( demux_t *p_demux )
if
(
i_fd
<
0
)
{
msg_Err
(
p_demux
,
"cannot open OSS audio device (%m)"
);
msg_Err
(
p_demux
,
"cannot open OSS audio device (%s)"
,
vlc_strerror_c
(
errno
)
);
goto
adev_fail
;
}
...
...
@@ -348,21 +349,24 @@ static int OpenAudioDevOss( demux_t *p_demux )
||
i_format
!=
AFMT_S16_LE
)
{
msg_Err
(
p_demux
,
"cannot set audio format (16b little endian) (%m)"
);
"cannot set audio format (16b little endian) (%s)"
,
vlc_strerror_c
(
errno
)
);
goto
adev_fail
;
}
if
(
ioctl
(
i_fd
,
SNDCTL_DSP_STEREO
,
&
p_demux
->
p_sys
->
b_stereo
)
<
0
)
{
msg_Err
(
p_demux
,
"cannot set audio channels count (%m)"
);
msg_Err
(
p_demux
,
"cannot set audio channels count (%s)"
,
vlc_strerror_c
(
errno
)
);
goto
adev_fail
;
}
if
(
ioctl
(
i_fd
,
SNDCTL_DSP_SPEED
,
&
p_demux
->
p_sys
->
i_sample_rate
)
<
0
)
{
msg_Err
(
p_demux
,
"cannot set audio sample rate (%m)"
);
msg_Err
(
p_demux
,
"cannot set audio sample rate (%s)"
,
vlc_strerror_c
(
errno
)
);
goto
adev_fail
;
}
...
...
@@ -415,14 +419,16 @@ static bool ProbeAudioDevOss( demux_t *p_demux, const char *psz_device )
if
(
i_fd
<
0
)
{
msg_Err
(
p_demux
,
"cannot open device %s for OSS audio (%m)"
,
psz_device
);
msg_Err
(
p_demux
,
"cannot open device %s for OSS audio (%s)"
,
psz_device
,
vlc_strerror_c
(
errno
)
);
goto
open_failed
;
}
/* this will fail if the device is video */
if
(
ioctl
(
i_fd
,
SNDCTL_DSP_GETCAPS
,
&
i_caps
)
<
0
)
{
msg_Err
(
p_demux
,
"cannot get audio caps (%m)"
);
msg_Err
(
p_demux
,
"cannot get audio caps (%s)"
,
vlc_strerror_c
(
errno
)
);
goto
open_failed
;
}
...
...
modules/audio_output/oss.c
View file @
cfc2e718
...
...
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <math.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
...
...
@@ -98,7 +99,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
int
fd
=
vlc_open
(
device
,
O_WRONLY
);
if
(
fd
==
-
1
)
{
msg_Err
(
aout
,
"cannot open OSS device %s: %m"
,
device
);
msg_Err
(
aout
,
"cannot open OSS device %s: %s"
,
device
,
vlc_strerror_c
(
errno
));
return
VLC_EGENERIC
;
}
sys
->
fd
=
fd
;
...
...
@@ -140,7 +142,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
if
(
ioctl
(
fd
,
SNDCTL_DSP_SETFMT
,
&
format
)
<
0
)
{
msg_Err
(
aout
,
"cannot set audio format 0x%X: %m"
,
format
);
msg_Err
(
aout
,
"cannot set audio format 0x%X: %s"
,
format
,
vlc_strerror_c
(
errno
));
goto
error
;
}
...
...
@@ -167,7 +170,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
int
channels
=
spdif
?
2
:
aout_FormatNbChannels
(
fmt
);
if
(
ioctl
(
fd
,
SNDCTL_DSP_CHANNELS
,
&
channels
)
<
0
)
{
msg_Err
(
aout
,
"cannot set %d channels: %m"
,
channels
);
msg_Err
(
aout
,
"cannot set %d channels: %s"
,
channels
,
vlc_strerror_c
(
errno
));
goto
error
;
}
...
...
@@ -187,7 +191,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
int
rate
=
spdif
?
48000
:
fmt
->
i_rate
;
if
(
ioctl
(
fd
,
SNDCTL_DSP_SPEED
,
&
rate
)
<
0
)
{
msg_Err
(
aout
,
"cannot set %d Hz sample rate: %m"
,
rate
);
msg_Err
(
aout
,
"cannot set %d Hz sample rate: %s"
,
rate
,
vlc_strerror_c
(
errno
));
goto
error
;
}
...
...
@@ -226,7 +231,7 @@ static int TimeGet (audio_output_t *aout, mtime_t *restrict pts)
if
(
ioctl
(
sys
->
fd
,
SNDCTL_DSP_GETODELAY
,
&
delay
)
<
0
)
{
msg_Warn
(
aout
,
"cannot get delay: %
m"
);
msg_Warn
(
aout
,
"cannot get delay: %
s"
,
vlc_strerror_c
(
errno
)
);
return
-
1
;
}
...
...
@@ -252,7 +257,7 @@ static void Play (audio_output_t *aout, block_t *block)
block
->
i_buffer
-=
bytes
;
}
else
msg_Err
(
aout
,
"cannot write samples: %
m"
);
msg_Err
(
aout
,
"cannot write samples: %
s"
,
vlc_strerror_c
(
errno
)
);
}
block_Release
(
block
);
...
...
@@ -329,7 +334,7 @@ static int VolumeSet (audio_output_t *aout, float vol)
level
|=
level
<<
8
;
if
(
!
sys
->
mute
&&
ioctl
(
fd
,
SNDCTL_DSP_SETPLAYVOL
,
&
level
)
<
0
)
{
msg_Err
(
aout
,
"cannot set volume: %
m"
);
msg_Err
(
aout
,
"cannot set volume: %
s"
,
vlc_strerror_c
(
errno
)
);
return
-
1
;
}
...
...
@@ -348,7 +353,7 @@ static int MuteSet (audio_output_t *aout, bool mute)
int
level
=
mute
?
0
:
(
sys
->
level
|
(
sys
->
level
<<
8
));
if
(
ioctl
(
fd
,
SNDCTL_DSP_SETPLAYVOL
,
&
level
)
<
0
)
{
msg_Err
(
aout
,
"cannot mute: %
m"
);
msg_Err
(
aout
,
"cannot mute: %
s"
,
vlc_strerror_c
(
errno
)
);
return
-
1
;
}
...
...
@@ -368,7 +373,7 @@ static int DevicesEnum (audio_output_t *aout)
if
(
ioctl
(
fd
,
SNDCTL_SYSINFO
,
&
si
)
<
0
)
{
msg_Err
(
aout
,
"cannot get system infos: %
m"
);
msg_Err
(
aout
,
"cannot get system infos: %
s"
,
vlc_strerror
(
errno
)
);
goto
out
;
}
...
...
@@ -381,7 +386,8 @@ static int DevicesEnum (audio_output_t *aout)
if
(
ioctl
(
fd
,
SNDCTL_AUDIOINFO
,
&
ai
)
<
0
)
{
msg_Warn
(
aout
,
"cannot get device %d infos: %m"
,
i
);
msg_Warn
(
aout
,
"cannot get device %d infos: %s"
,
i
,
vlc_strerror_c
(
errno
));
continue
;
}
if
(
ai
.
caps
&
(
PCM_CAP_HIDDEN
|
PCM_CAP_MODEM
))
...
...
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