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
a19eee78
Commit
a19eee78
authored
Apr 05, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Bridge: make many attributes private
parent
6be3c998
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
Bridge.hxx
src/decoder/Bridge.hxx
+18
-0
Thread.cxx
src/decoder/Thread.cxx
+7
-10
No files found.
src/decoder/Bridge.hxx
View file @
a19eee78
...
...
@@ -40,6 +40,7 @@ class DecoderBridge final : public DecoderClient {
public
:
DecoderControl
&
dc
;
private
:
/**
* For converting input data to the configured audio format.
* nullptr means no conversion necessary.
...
...
@@ -83,12 +84,14 @@ public:
*/
std
::
unique_ptr
<
Tag
>
song_tag
;
public
:
/** the last tag received from the stream */
std
::
unique_ptr
<
Tag
>
stream_tag
;
/** the last tag received from the decoder plugin */
std
::
unique_ptr
<
Tag
>
decoder_tag
;
private
:
/** the chunk currently being written to */
MusicChunkPtr
current_chunk
;
...
...
@@ -106,11 +109,16 @@ public:
*/
std
::
exception_ptr
error
;
public
:
DecoderBridge
(
DecoderControl
&
_dc
,
bool
_initial_seek_pending
,
std
::
unique_ptr
<
Tag
>
_tag
)
noexcept
;
~
DecoderBridge
()
noexcept
;
void
Reset
()
noexcept
{
error
=
{};
}
/**
* Should be read operation be cancelled? That is the case when the
* player thread has sent a command such as "STOP".
...
...
@@ -135,6 +143,16 @@ public:
*/
void
FlushChunk
()
noexcept
;
void
CheckFlushChunk
()
{
if
(
current_chunk
!=
nullptr
)
FlushChunk
();
}
void
CheckRethrowError
()
{
if
(
error
)
std
::
rethrow_exception
(
error
);
}
/* virtual methods from DecoderClient */
void
Ready
(
AudioFormat
audio_format
,
bool
seekable
,
SignedSongTime
duration
)
override
;
...
...
src/decoder/Thread.cxx
View file @
a19eee78
...
...
@@ -210,7 +210,7 @@ decoder_run_stream_plugin(DecoderBridge &bridge, InputStream &is,
if
(
!
decoder_check_plugin
(
plugin
,
is
,
suffix
))
return
false
;
bridge
.
error
=
std
::
exception_ptr
();
bridge
.
Reset
();
tried_r
=
true
;
return
decoder_stream_decode
(
plugin
,
bridge
,
is
);
...
...
@@ -316,7 +316,7 @@ TryDecoderFile(DecoderBridge &bridge, Path path_fs, const char *suffix,
if
(
!
plugin
.
SupportsSuffix
(
suffix
))
return
false
;
bridge
.
error
=
std
::
exception_ptr
();
bridge
.
Reset
();
DecoderControl
&
dc
=
bridge
.
dc
;
...
...
@@ -344,7 +344,7 @@ TryContainerDecoder(DecoderBridge &bridge, Path path_fs, const char *suffix,
!
plugin
.
SupportsSuffix
(
suffix
))
return
false
;
bridge
.
error
=
nullptr
;
bridge
.
Reset
()
;
DecoderControl
&
dc
=
bridge
.
dc
;
const
std
::
lock_guard
<
Mutex
>
protect
(
dc
.
mutex
);
...
...
@@ -472,19 +472,16 @@ decoder_run_song(DecoderControl &dc,
AtScopeExit
(
&
bridge
)
{
/* flush the last chunk */
if
(
bridge
.
current_chunk
!=
nullptr
)
bridge
.
FlushChunk
();
bridge
.
CheckFlushChunk
();
};
success
=
DecoderUnlockedRunUri
(
bridge
,
uri
,
path_fs
);
}
if
(
bridge
.
error
)
{
/* copy the Error from struct Decoder to
DecoderControl */
std
::
rethrow_exception
(
bridge
.
error
);
}
else
if
(
success
)
bridge
.
CheckRethrowError
();
if
(
success
)
dc
.
state
=
DecoderState
::
STOP
;
else
{
const
char
*
error_uri
=
song
.
GetURI
();
...
...
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