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
68bcfd8b
Commit
68bcfd8b
authored
Mar 25, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_filter: check for partial writes
parent
1d332746
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
run_filter.cxx
test/run_filter.cxx
+16
-1
No files found.
test/run_filter.cxx
View file @
68bcfd8b
...
...
@@ -95,6 +95,21 @@ FullRead(FileDescriptor fd, void *_buffer, size_t size)
}
}
static
void
FullWrite
(
FileDescriptor
fd
,
const
void
*
_buffer
,
size_t
size
)
{
auto
buffer
=
(
const
uint8_t
*
)
_buffer
;
while
(
size
>
0
)
{
size_t
nbytes
=
WriteOrThrow
(
fd
,
buffer
,
size
);
if
(
nbytes
==
0
)
throw
std
::
runtime_error
(
"Premature end of input"
);
buffer
+=
nbytes
;
size
-=
nbytes
;
}
}
static
size_t
ReadFrames
(
FileDescriptor
fd
,
void
*
_buffer
,
size_t
size
,
size_t
frame_size
)
{
...
...
@@ -163,7 +178,7 @@ try {
break
;
auto
dest
=
filter
->
FilterPCM
({(
const
void
*
)
buffer
,
(
size_t
)
nbytes
});
WriteOrThrow
(
output_fd
,
dest
.
data
,
dest
.
size
);
FullWrite
(
output_fd
,
dest
.
data
,
dest
.
size
);
}
/* cleanup and exit */
...
...
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