Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
afbaa9a7
Commit
afbaa9a7
authored
10 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
avdevice/oss_audio: avoid strerror() and errbuf
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e60c025e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavdevice/oss_audio.c
+4
-6
4 additions, 6 deletions
libavdevice/oss_audio.c
with
4 additions
and
6 deletions
libavdevice/oss_audio.c
+
4
−
6
View file @
afbaa9a7
...
@@ -49,14 +49,13 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
...
@@ -49,14 +49,13 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
int
audio_fd
;
int
audio_fd
;
int
tmp
,
err
;
int
tmp
,
err
;
char
*
flip
=
getenv
(
"AUDIO_FLIP_LEFT"
);
char
*
flip
=
getenv
(
"AUDIO_FLIP_LEFT"
);
char
errbuff
[
128
];
if
(
is_output
)
if
(
is_output
)
audio_fd
=
avpriv_open
(
audio_device
,
O_WRONLY
);
audio_fd
=
avpriv_open
(
audio_device
,
O_WRONLY
);
else
else
audio_fd
=
avpriv_open
(
audio_device
,
O_RDONLY
);
audio_fd
=
avpriv_open
(
audio_device
,
O_RDONLY
);
if
(
audio_fd
<
0
)
{
if
(
audio_fd
<
0
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
audio_device
,
strerror
(
errno
));
av_log
(
s1
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
audio_device
,
av_err2str
(
AVERROR
(
errno
))
)
;
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
...
@@ -67,7 +66,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
...
@@ -67,7 +66,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
/* non blocking mode */
/* non blocking mode */
if
(
!
is_output
)
{
if
(
!
is_output
)
{
if
(
fcntl
(
audio_fd
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
if
(
fcntl
(
audio_fd
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
av_log
(
s1
,
AV_LOG_WARNING
,
"%s: Could not enable non block mode (%s)
\n
"
,
audio_device
,
strerror
(
errno
));
av_log
(
s1
,
AV_LOG_WARNING
,
"%s: Could not enable non block mode (%s)
\n
"
,
audio_device
,
av_err2str
(
AVERROR
(
errno
))
)
;
}
}
}
}
...
@@ -75,8 +74,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
...
@@ -75,8 +74,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
#define CHECK_IOCTL_ERROR(event) \
#define CHECK_IOCTL_ERROR(event) \
if (err < 0) { \
if (err < 0) { \
av_strerror(AVERROR(errno), errbuff, sizeof(errbuff)); \
av_log(s1, AV_LOG_ERROR, #event ": %s\n", av_err2str(AVERROR(errno)));\
av_log(s1, AV_LOG_ERROR, #event ": %s\n", errbuff); \
goto fail; \
goto fail; \
}
}
...
@@ -86,7 +84,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
...
@@ -86,7 +84,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
* fail anyway. */
* fail anyway. */
err
=
ioctl
(
audio_fd
,
SNDCTL_DSP_GETFMTS
,
&
tmp
);
err
=
ioctl
(
audio_fd
,
SNDCTL_DSP_GETFMTS
,
&
tmp
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
av_log
(
s1
,
AV_LOG_WARNING
,
"SNDCTL_DSP_GETFMTS: %s
\n
"
,
strerror
(
errno
));
av_log
(
s1
,
AV_LOG_WARNING
,
"SNDCTL_DSP_GETFMTS: %s
\n
"
,
av_err2str
(
AVERROR
(
errno
))
)
;
}
}
#if HAVE_BIGENDIAN
#if HAVE_BIGENDIAN
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment