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
f8eeded5
Commit
f8eeded5
authored
Jan 25, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/async: pass EventLoop& to constructor
parent
c3fa7e13
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
14 deletions
+16
-14
AsyncInputStream.cxx
src/input/AsyncInputStream.cxx
+8
-8
AsyncInputStream.hxx
src/input/AsyncInputStream.hxx
+1
-1
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+1
-1
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+5
-3
NfsInputPlugin.cxx
src/input/plugins/NfsInputPlugin.cxx
+1
-1
No files found.
src/input/AsyncInputStream.cxx
View file @
f8eeded5
...
...
@@ -22,20 +22,20 @@
#include "Domain.hxx"
#include "tag/Tag.hxx"
#include "thread/Cond.hxx"
#include "
IOThread
.hxx"
#include "
event/Loop
.hxx"
#include <stdexcept>
#include <assert.h>
#include <string.h>
AsyncInputStream
::
AsyncInputStream
(
const
char
*
_url
,
AsyncInputStream
::
AsyncInputStream
(
EventLoop
&
event_loop
,
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
,
size_t
_buffer_size
,
size_t
_resume_at
)
:
InputStream
(
_url
,
_mutex
,
_cond
),
deferred_resume
(
io_thread_get
()
,
BIND_THIS_METHOD
(
DeferredResume
)),
deferred_seek
(
io_thread_get
()
,
BIND_THIS_METHOD
(
DeferredSeek
)),
deferred_resume
(
event_loop
,
BIND_THIS_METHOD
(
DeferredResume
)),
deferred_seek
(
event_loop
,
BIND_THIS_METHOD
(
DeferredSeek
)),
allocation
(
_buffer_size
),
buffer
((
uint8_t
*
)
allocation
.
get
(),
_buffer_size
),
resume_at
(
_resume_at
),
...
...
@@ -61,7 +61,7 @@ AsyncInputStream::SetTag(Tag *_tag)
void
AsyncInputStream
::
Pause
()
{
assert
(
io_thread_i
nside
());
assert
(
GetEventLoop
().
IsI
nside
());
paused
=
true
;
}
...
...
@@ -69,7 +69,7 @@ AsyncInputStream::Pause()
inline
void
AsyncInputStream
::
Resume
()
{
assert
(
io_thread_i
nside
());
assert
(
GetEventLoop
().
IsI
nside
());
if
(
paused
)
{
paused
=
false
;
...
...
@@ -143,7 +143,7 @@ AsyncInputStream::Seek(offset_type new_offset)
void
AsyncInputStream
::
SeekDone
()
{
assert
(
io_thread_i
nside
());
assert
(
GetEventLoop
().
IsI
nside
());
assert
(
IsSeekPending
());
/* we may have reached end-of-file previously, and the
...
...
@@ -174,7 +174,7 @@ AsyncInputStream::IsAvailable()
size_t
AsyncInputStream
::
Read
(
void
*
ptr
,
size_t
read_size
)
{
assert
(
!
io_thread_i
nside
());
assert
(
!
GetEventLoop
().
IsI
nside
());
/* wait for data */
CircularBuffer
<
uint8_t
>::
Range
r
;
...
...
src/input/AsyncInputStream.hxx
View file @
f8eeded5
...
...
@@ -73,7 +73,7 @@ public:
* @param _buffer a buffer allocated with HugeAllocate(); the
* destructor will free it using HugeFree()
*/
AsyncInputStream
(
const
char
*
_url
,
AsyncInputStream
(
EventLoop
&
event_loop
,
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
,
size_t
_buffer_size
,
size_t
_resume_at
);
...
...
src/input/plugins/AlsaInputPlugin.cxx
View file @
f8eeded5
...
...
@@ -76,7 +76,7 @@ public:
const
char
*
_uri
,
Mutex
&
_mutex
,
Cond
&
_cond
,
const
char
*
_device
,
snd_pcm_t
*
_handle
,
int
_frame_size
)
:
AsyncInputStream
(
_uri
,
_mutex
,
_cond
,
:
AsyncInputStream
(
loop
,
_uri
,
_mutex
,
_cond
,
ALSA_MAX_BUFFERED
,
ALSA_RESUME_AT
),
MultiSocketMonitor
(
loop
),
DeferredMonitor
(
loop
),
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
f8eeded5
...
...
@@ -74,8 +74,9 @@ struct CurlInputStream final : public AsyncInputStream, CurlResponseHandler {
/** parser for icy-metadata */
IcyInputStream
*
icy
;
CurlInputStream
(
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
)
:
AsyncInputStream
(
_url
,
_mutex
,
_cond
,
CurlInputStream
(
EventLoop
&
event_loop
,
const
char
*
_url
,
Mutex
&
_mutex
,
Cond
&
_cond
)
:
AsyncInputStream
(
event_loop
,
_url
,
_mutex
,
_cond
,
CURL_MAX_BUFFERED
,
CURL_RESUME_AT
),
icy
(
new
IcyInputStream
(
this
))
{
...
...
@@ -420,7 +421,8 @@ CurlInputStream::DoSeek(offset_type new_offset)
inline
InputStream
*
CurlInputStream
::
Open
(
const
char
*
url
,
Mutex
&
mutex
,
Cond
&
cond
)
{
CurlInputStream
*
c
=
new
CurlInputStream
(
url
,
mutex
,
cond
);
CurlInputStream
*
c
=
new
CurlInputStream
(
curl_global
->
GetEventLoop
(),
url
,
mutex
,
cond
);
try
{
BlockingCall
(
c
->
GetEventLoop
(),
[
c
](){
...
...
src/input/plugins/NfsInputPlugin.cxx
View file @
f8eeded5
...
...
@@ -48,7 +48,7 @@ class NfsInputStream final : public AsyncInputStream, NfsFileReader {
public
:
NfsInputStream
(
const
char
*
_uri
,
Mutex
&
_mutex
,
Cond
&
_cond
)
:
AsyncInputStream
(
_uri
,
_mutex
,
_cond
,
:
AsyncInputStream
(
io_thread_get
(),
_uri
,
_mutex
,
_cond
,
NFS_MAX_BUFFERED
,
NFS_RESUME_AT
),
NfsFileReader
(
io_thread_get
()),
...
...
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