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
ae4b30a6
Commit
ae4b30a6
authored
May 23, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: add "pause" flag
Don't access AudioOutput::pause.
parent
35329916
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
HttpdInternal.hxx
src/output/plugins/httpd/HttpdInternal.hxx
+2
-0
HttpdOutputPlugin.cxx
src/output/plugins/httpd/HttpdOutputPlugin.cxx
+6
-1
No files found.
src/output/plugins/httpd/HttpdInternal.hxx
View file @
ae4b30a6
...
@@ -60,6 +60,8 @@ class HttpdOutput final : ServerSocket, DeferredMonitor {
...
@@ -60,6 +60,8 @@ class HttpdOutput final : ServerSocket, DeferredMonitor {
*/
*/
bool
open
;
bool
open
;
bool
pause
;
/**
/**
* The configured encoder plugin.
* The configured encoder plugin.
*/
*/
...
...
src/output/plugins/httpd/HttpdOutputPlugin.cxx
View file @
ae4b30a6
...
@@ -261,6 +261,7 @@ HttpdOutput::Open(AudioFormat &audio_format)
...
@@ -261,6 +261,7 @@ HttpdOutput::Open(AudioFormat &audio_format)
timer
=
new
Timer
(
audio_format
);
timer
=
new
Timer
(
audio_format
);
open
=
true
;
open
=
true
;
pause
=
false
;
}
}
inline
void
inline
void
...
@@ -302,7 +303,7 @@ HttpdOutput::SendHeader(HttpdClient &client) const
...
@@ -302,7 +303,7 @@ HttpdOutput::SendHeader(HttpdClient &client) const
inline
std
::
chrono
::
steady_clock
::
duration
inline
std
::
chrono
::
steady_clock
::
duration
HttpdOutput
::
Delay
()
const
noexcept
HttpdOutput
::
Delay
()
const
noexcept
{
{
if
(
!
LockHasClients
()
&&
base
.
pause
)
{
if
(
!
LockHasClients
()
&&
pause
)
{
/* if there's no client and this output is paused,
/* if there's no client and this output is paused,
then httpd_output_pause() will not do anything, it
then httpd_output_pause() will not do anything, it
will not fill the buffer and it will not update the
will not fill the buffer and it will not update the
...
@@ -369,6 +370,8 @@ HttpdOutput::EncodeAndPlay(const void *chunk, size_t size)
...
@@ -369,6 +370,8 @@ HttpdOutput::EncodeAndPlay(const void *chunk, size_t size)
inline
size_t
inline
size_t
HttpdOutput
::
Play
(
const
void
*
chunk
,
size_t
size
)
HttpdOutput
::
Play
(
const
void
*
chunk
,
size_t
size
)
{
{
pause
=
false
;
if
(
LockHasClients
())
if
(
LockHasClients
())
EncodeAndPlay
(
chunk
,
size
);
EncodeAndPlay
(
chunk
,
size
);
...
@@ -382,6 +385,8 @@ HttpdOutput::Play(const void *chunk, size_t size)
...
@@ -382,6 +385,8 @@ HttpdOutput::Play(const void *chunk, size_t size)
bool
bool
HttpdOutput
::
Pause
()
HttpdOutput
::
Pause
()
{
{
pause
=
true
;
if
(
LockHasClients
())
{
if
(
LockHasClients
())
{
static
const
char
silence
[
1020
]
=
{
0
};
static
const
char
silence
[
1020
]
=
{
0
};
Play
(
silence
,
sizeof
(
silence
));
Play
(
silence
,
sizeof
(
silence
));
...
...
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