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
3fb25d40
Commit
3fb25d40
authored
Mar 08, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_convert: move code to RunConvert()
parent
e227596c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
run_convert.cxx
test/run_convert.cxx
+17
-14
No files found.
test/run_convert.cxx
View file @
3fb25d40
...
@@ -101,18 +101,9 @@ public:
...
@@ -101,18 +101,9 @@ public:
}
}
};
};
int
static
void
main
(
int
argc
,
char
**
argv
)
RunConvert
(
PcmConvert
&
convert
,
size_t
in_frame_size
)
try
{
{
const
auto
c
=
ParseCommandLine
(
argc
,
argv
);
SetLogThreshold
(
c
.
verbose
?
LogLevel
::
DEBUG
:
LogLevel
::
INFO
);
const
GlobalInit
init
(
c
.
config_path
);
const
size_t
in_frame_size
=
c
.
in_audio_format
.
GetFrameSize
();
PcmConvert
state
(
c
.
in_audio_format
,
c
.
out_audio_format
);
StaticFifoBuffer
<
uint8_t
,
4096
>
buffer
;
StaticFifoBuffer
<
uint8_t
,
4096
>
buffer
;
while
(
true
)
{
while
(
true
)
{
...
@@ -136,20 +127,32 @@ try {
...
@@ -136,20 +127,32 @@ try {
buffer
.
Consume
(
src
.
size
);
buffer
.
Consume
(
src
.
size
);
auto
output
=
state
.
Convert
({
src
.
data
,
src
.
size
});
auto
output
=
convert
.
Convert
({
src
.
data
,
src
.
size
});
[[
maybe_unused
]]
ssize_t
ignored
=
write
(
1
,
output
.
data
,
[[
maybe_unused
]]
ssize_t
ignored
=
write
(
1
,
output
.
data
,
output
.
size
);
output
.
size
);
}
}
while
(
true
)
{
while
(
true
)
{
auto
output
=
state
.
Flush
();
auto
output
=
convert
.
Flush
();
if
(
output
.
IsNull
())
if
(
output
.
IsNull
())
break
;
break
;
[[
maybe_unused
]]
ssize_t
ignored
=
write
(
1
,
output
.
data
,
[[
maybe_unused
]]
ssize_t
ignored
=
write
(
1
,
output
.
data
,
output
.
size
);
output
.
size
);
}
}
}
int
main
(
int
argc
,
char
**
argv
)
try
{
const
auto
c
=
ParseCommandLine
(
argc
,
argv
);
SetLogThreshold
(
c
.
verbose
?
LogLevel
::
DEBUG
:
LogLevel
::
INFO
);
const
GlobalInit
init
(
c
.
config_path
);
PcmConvert
state
(
c
.
in_audio_format
,
c
.
out_audio_format
);
RunConvert
(
state
,
c
.
in_audio_format
.
GetFrameSize
());
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
catch
(...)
{
}
catch
(...)
{
...
...
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