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
964b2661
Commit
964b2661
authored
Dec 31, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: add methods Init(), Finish()
parent
8b65b524
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
HttpdInternal.hxx
src/output/HttpdInternal.hxx
+19
-0
HttpdOutputPlugin.cxx
src/output/HttpdOutputPlugin.cxx
+10
-12
No files found.
src/output/HttpdInternal.hxx
View file @
964b2661
...
...
@@ -129,8 +129,27 @@ struct HttpdOutput final : private ServerSocket {
HttpdOutput
(
EventLoop
&
_loop
);
~
HttpdOutput
();
bool
Init
(
const
config_param
&
param
,
Error
&
error
);
void
Finish
()
{
ao_base_finish
(
&
base
);
}
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
audio_output
*
InitAndConfigure
(
const
config_param
&
param
,
Error
&
error
)
{
if
(
!
Init
(
param
,
error
))
return
nullptr
;
if
(
!
Configure
(
param
,
error
))
{
Finish
();
return
nullptr
;
}
return
&
base
;
}
bool
Bind
(
Error
&
error
);
void
Unbind
();
...
...
src/output/HttpdOutputPlugin.cxx
View file @
964b2661
...
...
@@ -128,24 +128,22 @@ HttpdOutput::Configure(const config_param ¶m, Error &error)
return
true
;
}
inline
bool
HttpdOutput
::
Init
(
const
config_param
&
param
,
Error
&
error
)
{
return
ao_base_init
(
&
base
,
&
httpd_output_plugin
,
param
,
error
);
}
static
struct
audio_output
*
httpd_output_init
(
const
config_param
&
param
,
Error
&
error
)
{
HttpdOutput
*
httpd
=
new
HttpdOutput
(
*
main_loop
);
if
(
!
ao_base_init
(
&
httpd
->
base
,
&
httpd_output_plugin
,
param
,
error
))
{
delete
httpd
;
return
nullptr
;
}
if
(
!
httpd
->
Configure
(
param
,
error
))
{
ao_base_finish
(
&
httpd
->
base
);
audio_output
*
result
=
httpd
->
InitAndConfigure
(
param
,
error
);
if
(
result
==
nullptr
)
delete
httpd
;
return
nullptr
;
}
return
&
httpd
->
base
;
return
result
;
}
#if GCC_CHECK_VERSION(4,6) || defined(__clang__)
...
...
@@ -168,7 +166,7 @@ httpd_output_finish(struct audio_output *ao)
{
HttpdOutput
*
httpd
=
Cast
(
ao
);
ao_base_finish
(
&
httpd
->
base
);
httpd
->
Finish
(
);
delete
httpd
;
}
...
...
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