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
78fa3f06
Commit
78fa3f06
authored
Jul 06, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: added command REOPEN
REOPEN is called when the input audio format changes. The output thread may be reconfigure the PCM converter.
parent
1350cd0e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
output_control.c
src/output_control.c
+1
-14
output_internal.h
src/output_internal.h
+7
-0
output_thread.c
src/output_thread.c
+25
-0
No files found.
src/output_control.c
View file @
78fa3f06
...
...
@@ -82,26 +82,13 @@ audio_output_open(struct audio_output *ao,
ao
->
in_audio_format
=
*
audio_format
;
ao
->
chunk
=
NULL
;
if
(
!
ao
->
config_audio_format
)
{
if
(
ao
->
open
)
audio_output_close
(
ao
);
/* no audio format is configured: copy in->out, let
the output's open() method determine the effective
out_audio_format */
ao
->
out_audio_format
=
ao
->
in_audio_format
;
}
ao
->
pipe
=
mp
;
if
(
ao
->
thread
==
NULL
)
audio_output_thread_start
(
ao
);
ao_command
(
ao
,
ao
->
open
?
AO_COMMAND_REOPEN
:
AO_COMMAND_OPEN
);
open
=
ao
->
open
;
if
(
!
open
)
{
ao_command
(
ao
,
AO_COMMAND_OPEN
);
open
=
ao
->
open
;
}
if
(
open
&&
ao
->
mixer
!=
NULL
)
mixer_open
(
ao
->
mixer
);
...
...
src/output_internal.h
View file @
78fa3f06
...
...
@@ -29,6 +29,13 @@
enum
audio_output_command
{
AO_COMMAND_NONE
=
0
,
AO_COMMAND_OPEN
,
/**
* This command is invoked when the input audio format
* changes.
*/
AO_COMMAND_REOPEN
,
AO_COMMAND_CLOSE
,
AO_COMMAND_PAUSE
,
AO_COMMAND_CANCEL
,
...
...
src/output_thread.c
View file @
78fa3f06
...
...
@@ -105,6 +105,26 @@ ao_close(struct audio_output *ao)
g_debug
(
"closed plugin=%s name=
\"
%s
\"
"
,
ao
->
plugin
->
name
,
ao
->
name
);
}
static
void
ao_reopen
(
struct
audio_output
*
ao
)
{
if
(
!
ao
->
config_audio_format
)
{
if
(
ao
->
open
)
{
const
struct
music_pipe
*
mp
=
ao
->
pipe
;
ao_close
(
ao
);
ao
->
pipe
=
mp
;
}
/* no audio format is configured: copy in->out, let
the output's open() method determine the effective
out_audio_format */
ao
->
out_audio_format
=
ao
->
in_audio_format
;
}
if
(
!
ao
->
open
)
ao_open
(
ao
);
}
static
bool
ao_play_chunk
(
struct
audio_output
*
ao
,
const
struct
music_chunk
*
chunk
)
{
...
...
@@ -237,6 +257,11 @@ static gpointer audio_output_task(gpointer arg)
ao_command_finished
(
ao
);
break
;
case
AO_COMMAND_REOPEN
:
ao_reopen
(
ao
);
ao_command_finished
(
ao
);
break
;
case
AO_COMMAND_CLOSE
:
assert
(
ao
->
open
);
assert
(
ao
->
pipe
!=
NULL
);
...
...
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