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
042c1abc
Commit
042c1abc
authored
Aug 31, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/pulse: use _delete_context()
Eliminate duplicate code.
parent
3d12d7de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
pulse_output_plugin.c
src/output/pulse_output_plugin.c
+15
-16
No files found.
src/output/pulse_output_plugin.c
View file @
042c1abc
...
...
@@ -225,6 +225,20 @@ pulse_output_connect(struct pulse_output *po, GError **error_r)
}
/**
* Frees and clears the context.
*/
static
void
pulse_output_delete_context
(
struct
pulse_output
*
po
)
{
assert
(
po
!=
NULL
);
assert
(
po
->
context
!=
NULL
);
pa_context_disconnect
(
po
->
context
);
pa_context_unref
(
po
->
context
);
po
->
context
=
NULL
;
}
/**
* Create, set up and connect a context.
*
* @return true on success, false on error
...
...
@@ -249,28 +263,13 @@ pulse_output_setup_context(struct pulse_output *po, GError **error_r)
pulse_output_subscribe_cb
,
po
);
if
(
!
pulse_output_connect
(
po
,
error_r
))
{
pa_context_unref
(
po
->
context
);
po
->
context
=
NULL
;
pulse_output_delete_context
(
po
);
return
false
;
}
return
true
;
}
/**
* Frees and clears the context.
*/
static
void
pulse_output_delete_context
(
struct
pulse_output
*
po
)
{
assert
(
po
!=
NULL
);
assert
(
po
->
context
!=
NULL
);
pa_context_disconnect
(
po
->
context
);
pa_context_unref
(
po
->
context
);
po
->
context
=
NULL
;
}
static
void
*
pulse_output_init
(
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
const
struct
config_param
*
param
,
...
...
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