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
1cde8682
Commit
1cde8682
authored
Oct 15, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/pipe: use std::string
parent
dbd88e6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
PipeOutputPlugin.cxx
src/output/PipeOutputPlugin.cxx
+6
-8
No files found.
src/output/PipeOutputPlugin.cxx
View file @
1cde8682
...
@@ -24,15 +24,14 @@
...
@@ -24,15 +24,14 @@
#include "util/Error.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "util/Domain.hxx"
#include <
glib.h
>
#include <
string
>
#include <stdio.h>
#include <stdio.h>
#include <errno.h>
struct
PipeOutput
{
struct
PipeOutput
{
struct
audio_output
base
;
struct
audio_output
base
;
char
*
cmd
;
std
::
string
cmd
;
FILE
*
fh
;
FILE
*
fh
;
bool
Initialize
(
const
config_param
&
param
,
Error
&
error
)
{
bool
Initialize
(
const
config_param
&
param
,
Error
&
error
)
{
...
@@ -52,8 +51,8 @@ static constexpr Domain pipe_output_domain("pipe_output");
...
@@ -52,8 +51,8 @@ static constexpr Domain pipe_output_domain("pipe_output");
inline
bool
inline
bool
PipeOutput
::
Configure
(
const
config_param
&
param
,
Error
&
error
)
PipeOutput
::
Configure
(
const
config_param
&
param
,
Error
&
error
)
{
{
cmd
=
param
.
DupBlockString
(
"command
"
);
cmd
=
param
.
GetBlockValue
(
"command"
,
"
"
);
if
(
cmd
==
nullptr
)
{
if
(
cmd
.
empty
()
)
{
error
.
Set
(
config_domain
,
error
.
Set
(
config_domain
,
"No
\"
command
\"
parameter specified"
);
"No
\"
command
\"
parameter specified"
);
return
false
;
return
false
;
...
@@ -86,7 +85,6 @@ pipe_output_finish(struct audio_output *ao)
...
@@ -86,7 +85,6 @@ pipe_output_finish(struct audio_output *ao)
{
{
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
g_free
(
pd
->
cmd
);
pd
->
Deinitialize
();
pd
->
Deinitialize
();
delete
pd
;
delete
pd
;
}
}
...
@@ -98,10 +96,10 @@ pipe_output_open(struct audio_output *ao,
...
@@ -98,10 +96,10 @@ pipe_output_open(struct audio_output *ao,
{
{
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
PipeOutput
*
pd
=
(
PipeOutput
*
)
ao
;
pd
->
fh
=
popen
(
pd
->
cmd
,
"w"
);
pd
->
fh
=
popen
(
pd
->
cmd
.
c_str
()
,
"w"
);
if
(
pd
->
fh
==
nullptr
)
{
if
(
pd
->
fh
==
nullptr
)
{
error
.
FormatErrno
(
"Error opening pipe
\"
%s
\"
"
,
error
.
FormatErrno
(
"Error opening pipe
\"
%s
\"
"
,
pd
->
cmd
);
pd
->
cmd
.
c_str
()
);
return
false
;
return
false
;
}
}
...
...
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