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
cfaf2ed0
Commit
cfaf2ed0
authored
Jul 30, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/pipewire: move code to CheckThrowError()
parent
60159608
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
PipeWireOutputPlugin.cxx
src/output/plugins/PipeWireOutputPlugin.cxx
+6
-2
No files found.
src/output/plugins/PipeWireOutputPlugin.cxx
View file @
cfaf2ed0
...
@@ -78,6 +78,11 @@ public:
...
@@ -78,6 +78,11 @@ public:
}
}
private
:
private
:
void
CheckThrowError
()
{
if
(
disconnected
)
throw
std
::
runtime_error
(
"Disconnected from PipeWire"
);
}
void
StateChanged
(
enum
pw_stream_state
state
,
void
StateChanged
(
enum
pw_stream_state
state
,
[[
maybe_unused
]]
const
char
*
error
)
noexcept
{
[[
maybe_unused
]]
const
char
*
error
)
noexcept
{
const
bool
was_disconnected
=
disconnected
;
const
bool
was_disconnected
=
disconnected
;
...
@@ -298,8 +303,7 @@ PipeWireOutput::Play(const void *chunk, size_t size)
...
@@ -298,8 +303,7 @@ PipeWireOutput::Play(const void *chunk, size_t size)
const
PipeWire
::
ThreadLoopLock
lock
(
thread_loop
);
const
PipeWire
::
ThreadLoopLock
lock
(
thread_loop
);
while
(
true
)
{
while
(
true
)
{
if
(
disconnected
)
CheckThrowError
();
throw
std
::
runtime_error
(
"Disconnected from PipeWire"
);
std
::
size_t
bytes_written
=
std
::
size_t
bytes_written
=
ring_buffer
->
push
((
const
std
::
byte
*
)
chunk
,
size
);
ring_buffer
->
push
((
const
std
::
byte
*
)
chunk
,
size
);
...
...
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