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
e8aee4d9
Commit
e8aee4d9
authored
Feb 10, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output_thread: moved code to ao_close()
Merge some duplicate code into one function.
parent
a96993f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
output_thread.c
src/output_thread.c
+14
-12
No files found.
src/output_thread.c
View file @
e8aee4d9
...
...
@@ -38,6 +38,16 @@ static void ao_command_finished(struct audio_output *ao)
notify_signal
(
&
audio_output_client_notify
);
}
static
void
ao_close
(
struct
audio_output
*
ao
)
{
assert
(
ao
->
open
);
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
convert_state
);
ao
->
open
=
false
;
}
static
void
ao_play
(
struct
audio_output
*
ao
)
{
const
char
*
data
=
ao
->
args
.
play
.
data
;
...
...
@@ -62,9 +72,7 @@ static void ao_play(struct audio_output *ao)
ret
=
ao
->
plugin
->
play
(
ao
->
data
,
data
,
size
);
if
(
!
ret
)
{
ao
->
plugin
->
cancel
(
ao
->
data
);
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
convert_state
);
ao
->
open
=
false
;
ao_close
(
ao
);
}
ao_command_finished
(
ao
);
...
...
@@ -83,17 +91,13 @@ 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
->
convert_state
);
ao
->
open
=
false
;
ao_close
(
ao
);
break
;
}
}
while
(
ao
->
command
==
AO_COMMAND_NONE
);
}
else
{
/* pause is not supported - simply close the device */
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
convert_state
);
ao
->
open
=
false
;
ao_close
(
ao
);
ao_command_finished
(
ao
);
}
}
...
...
@@ -127,10 +131,8 @@ static gpointer audio_output_task(gpointer arg)
case
AO_COMMAND_CLOSE
:
assert
(
ao
->
open
);
ao
->
plugin
->
cancel
(
ao
->
data
);
ao
->
plugin
->
close
(
ao
->
data
);
pcm_convert_deinit
(
&
ao
->
convert_state
);
ao
->
open
=
false
;
ao_close
(
ao
);
ao_command_finished
(
ao
);
break
;
...
...
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