Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
6722c508
Commit
6722c508
authored
Feb 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mvp: mvp_set_pcm_params() returns bool
Return true/false instead of 0/-1. Also check its return value in mvp_output_open().
parent
84ed6d47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
mvp_plugin.c
src/output/mvp_plugin.c
+14
-9
No files found.
src/output/mvp_plugin.c
View file @
6722c508
...
...
@@ -118,7 +118,7 @@ mvp_output_finish(void *data)
g_free
(
md
);
}
static
int
static
bool
mvp_set_pcm_params
(
struct
mvp_data
*
md
,
struct
audio_format
*
audio_format
)
{
unsigned
iloop
;
...
...
@@ -134,7 +134,7 @@ mvp_set_pcm_params(struct mvp_data *md, struct audio_format *audio_format)
break
;
default:
return
-
1
;
return
false
;
}
/* 0,1=24bit(24) , 2,3=16bit */
...
...
@@ -148,7 +148,7 @@ mvp_set_pcm_params(struct mvp_data *md, struct audio_format *audio_format)
break
;
default:
return
-
1
;
return
false
;
}
mix
[
3
]
=
0
;
/* stream type? */
...
...
@@ -167,25 +167,25 @@ mvp_set_pcm_params(struct mvp_data *md, struct audio_format *audio_format)
if
(
iloop
>=
G_N_ELEMENTS
(
mvp_sample_rates
))
{
g_warning
(
"Can not find suitable output frequency for %u
\n
"
,
audio_format
->
sample_rate
);
return
-
1
;
return
false
;
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_FORMAT
,
&
mix
)
<
0
)
{
g_warning
(
"Can not set audio format
\n
"
);
return
-
1
;
return
false
;
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_SYNC
,
2
)
!=
0
)
{
g_warning
(
"Can not set audio sync
\n
"
);
return
-
1
;
return
false
;
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_PLAY
,
0
)
<
0
)
{
g_warning
(
"Can not set audio play mode
\n
"
);
return
-
1
;
return
false
;
}
return
0
;
return
true
;
}
static
bool
...
...
@@ -194,6 +194,7 @@ mvp_output_open(void *data, struct audio_format *audio_format)
struct
mvp_data
*
md
=
data
;
long
long
int
stc
=
0
;
int
mix
[
5
]
=
{
0
,
2
,
7
,
1
,
0
};
bool
success
;
if
((
md
->
fd
=
open
(
"/dev/adec_pcm"
,
O_RDWR
|
O_NONBLOCK
))
<
0
)
{
g_warning
(
"Error opening /dev/adec_pcm: %s
\n
"
,
...
...
@@ -221,7 +222,11 @@ mvp_output_open(void *data, struct audio_format *audio_format)
strerror
(
errno
));
return
false
;
}
mvp_set_pcm_params
(
md
,
audio_format
);
success
=
mvp_set_pcm_params
(
md
,
audio_format
);
if
(
!
success
)
return
false
;
md
->
audio_format
=
*
audio_format
;
return
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