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
61e30759
Commit
61e30759
authored
Feb 10, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output_api: no CamelCase in struct audio_output
Renamed audio_output struct members.
parent
744702f2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
26 deletions
+27
-26
output_control.c
src/output_control.c
+8
-8
output_init.c
src/output_init.c
+5
-4
output_internal.h
src/output_internal.h
+6
-6
output_thread.c
src/output_thread.c
+8
-8
No files found.
src/output_control.c
View file @
61e30759
...
...
@@ -56,22 +56,22 @@ audio_output_open(struct audio_output *audioOutput,
audioOutput
->
reopen_after
=
0
;
if
(
audioOutput
->
open
&&
audio_format_equals
(
audioFormat
,
&
audioOutput
->
in
AudioF
ormat
))
{
audio_format_equals
(
audioFormat
,
&
audioOutput
->
in
_audio_f
ormat
))
{
return
true
;
}
audioOutput
->
in
AudioF
ormat
=
*
audioFormat
;
audioOutput
->
in
_audio_f
ormat
=
*
audioFormat
;
if
(
audio_format_defined
(
&
audioOutput
->
reqAudioF
ormat
))
{
/* copy
reqAudioFormat to outAudioF
ormat only if the
if
(
audio_format_defined
(
&
audioOutput
->
config_audio_f
ormat
))
{
/* copy
config_audio_format to out_audio_f
ormat only if the
device is not yet open; if it is already open,
plugin->open() may have modified out
AudioF
ormat,
plugin->open() may have modified out
_audio_f
ormat,
and the value is already ok */
if
(
!
audioOutput
->
open
)
audioOutput
->
out
AudioF
ormat
=
audioOutput
->
reqAudioF
ormat
;
audioOutput
->
out
_audio_f
ormat
=
audioOutput
->
config_audio_f
ormat
;
}
else
{
audioOutput
->
out
AudioFormat
=
audioOutput
->
inAudioF
ormat
;
audioOutput
->
out
_audio_format
=
audioOutput
->
in_audio_f
ormat
;
if
(
audioOutput
->
open
)
audio_output_close
(
audioOutput
);
}
...
...
src/output_init.c
View file @
61e30759
...
...
@@ -91,20 +91,21 @@ audio_output_init(struct audio_output *ao, const struct config_param *param)
ao
->
open
=
false
;
ao
->
reopen_after
=
0
;
pcm_convert_init
(
&
ao
->
conv
S
tate
);
pcm_convert_init
(
&
ao
->
conv
ert_s
tate
);
if
(
format
)
{
if
(
0
!=
parseAudioConfig
(
&
ao
->
reqAudioF
ormat
,
format
))
{
if
(
0
!=
parseAudioConfig
(
&
ao
->
config_audio_f
ormat
,
format
))
{
g_error
(
"error parsing format at line %i
\n
"
,
bp
->
line
);
}
}
else
audio_format_clear
(
&
ao
->
reqAudioF
ormat
);
audio_format_clear
(
&
ao
->
config_audio_f
ormat
);
ao
->
thread
=
NULL
;
notify_init
(
&
ao
->
notify
);
ao
->
command
=
AO_COMMAND_NONE
;
ao
->
data
=
plugin
->
init
(
ao
,
format
?
&
ao
->
reqAudioFormat
:
NULL
,
param
);
ao
->
data
=
plugin
->
init
(
ao
,
format
?
&
ao
->
config_audio_format
:
NULL
,
param
);
if
(
ao
->
data
==
NULL
)
return
0
;
...
...
src/output_internal.h
View file @
61e30759
...
...
@@ -63,23 +63,23 @@ struct audio_output {
* The audio_format in which audio data is received from the
* player thread (which in turn receives it from the decoder).
*/
struct
audio_format
in
AudioF
ormat
;
struct
audio_format
in
_audio_f
ormat
;
/**
* The audio_format which is really sent to the device. This
* is basically
reqAudioF
ormat (if configured) or
* in
AudioF
ormat, but may have been modified by
* is basically
config_audio_f
ormat (if configured) or
* in
_audio_f
ormat, but may have been modified by
* plugin->open().
*/
struct
audio_format
out
AudioF
ormat
;
struct
audio_format
out
_audio_f
ormat
;
/**
* The audio_format which was configured. Only set if
* convertAudioFormat is true.
*/
struct
audio_format
reqAudioF
ormat
;
struct
audio_format
config_audio_f
ormat
;
struct
pcm_convert_state
conv
S
tate
;
struct
pcm_convert_state
conv
ert_s
tate
;
/**
* The thread handle, or NULL if the output thread isn't
...
...
src/output_thread.c
View file @
61e30759
...
...
@@ -46,10 +46,10 @@ static void ao_play(struct audio_output *ao)
assert
(
size
>
0
);
if
(
!
audio_format_equals
(
&
ao
->
in
AudioFormat
,
&
ao
->
outAudioF
ormat
))
{
data
=
pcm_convert
(
&
ao
->
conv
S
tate
,
&
ao
->
in
AudioF
ormat
,
data
,
size
,
&
ao
->
out
AudioF
ormat
,
&
size
);
if
(
!
audio_format_equals
(
&
ao
->
in
_audio_format
,
&
ao
->
out_audio_f
ormat
))
{
data
=
pcm_convert
(
&
ao
->
conv
ert_s
tate
,
&
ao
->
in
_audio_f
ormat
,
data
,
size
,
&
ao
->
out
_audio_f
ormat
,
&
size
);
/* under certain circumstances, pcm_convert() may
return an empty buffer - this condition should be
...
...
@@ -63,7 +63,7 @@ static void ao_play(struct audio_output *ao)
if
(
!
ret
)
{
ao
->
plugin
->
cancel
(
ao
->
data
);
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
conv
S
tate
);
pcm_convert_deinit
(
&
ao
->
conv
ert_s
tate
);
ao
->
open
=
false
;
}
...
...
@@ -84,7 +84,7 @@ static void ao_pause(struct audio_output *ao)
ret
=
ao
->
plugin
->
pause
(
ao
->
data
);
if
(
!
ret
)
{
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
conv
S
tate
);
pcm_convert_deinit
(
&
ao
->
conv
ert_s
tate
);
ao
->
open
=
false
;
}
}
while
(
ao
->
command
==
AO_COMMAND_NONE
);
...
...
@@ -109,9 +109,9 @@ static gpointer audio_output_task(gpointer arg)
case
AO_COMMAND_OPEN
:
assert
(
!
ao
->
open
);
pcm_convert_init
(
&
ao
->
conv
S
tate
);
pcm_convert_init
(
&
ao
->
conv
ert_s
tate
);
ret
=
ao
->
plugin
->
open
(
ao
->
data
,
&
ao
->
out
AudioF
ormat
);
&
ao
->
out
_audio_f
ormat
);
assert
(
!
ao
->
open
);
if
(
ret
==
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