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
e699f678
Commit
e699f678
authored
Oct 28, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_control: rename to DecoderControl
parent
5f13c1cd
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
45 deletions
+45
-45
DecoderAPI.cxx
src/DecoderAPI.cxx
+10
-10
DecoderControl.cxx
src/DecoderControl.cxx
+8
-8
DecoderControl.hxx
src/DecoderControl.hxx
+6
-6
DecoderInternal.cxx
src/DecoderInternal.cxx
+3
-3
DecoderInternal.hxx
src/DecoderInternal.hxx
+3
-3
DecoderThread.cxx
src/DecoderThread.cxx
+9
-9
DecoderThread.hxx
src/DecoderThread.hxx
+2
-2
PlayerThread.cxx
src/PlayerThread.cxx
+4
-4
No files found.
src/DecoderAPI.cxx
View file @
e699f678
...
...
@@ -41,7 +41,7 @@ decoder_initialized(Decoder &decoder,
const
AudioFormat
audio_format
,
bool
seekable
,
float
total_time
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
struct
audio_format_string
af_string
;
assert
(
dc
.
state
==
DecoderState
::
START
);
...
...
@@ -81,7 +81,7 @@ gcc_pure
static
bool
decoder_prepare_initial_seek
(
Decoder
&
decoder
)
{
const
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
const
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
if
(
dc
.
state
!=
DecoderState
::
DECODE
)
...
...
@@ -128,7 +128,7 @@ gcc_pure
static
DecoderCommand
decoder_get_virtual_command
(
Decoder
&
decoder
)
{
const
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
const
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
if
(
decoder_prepare_initial_seek
(
decoder
))
...
...
@@ -146,7 +146,7 @@ decoder_get_command(Decoder &decoder)
void
decoder_command_finished
(
Decoder
&
decoder
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
dc
.
Lock
();
...
...
@@ -190,7 +190,7 @@ decoder_command_finished(Decoder &decoder)
double
decoder_seek_where
(
gcc_unused
Decoder
&
decoder
)
{
const
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
const
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
...
...
@@ -206,7 +206,7 @@ double decoder_seek_where(gcc_unused Decoder & decoder)
void
decoder_seek_error
(
Decoder
&
decoder
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
...
...
@@ -236,7 +236,7 @@ decoder_check_cancel_read(const Decoder *decoder)
if
(
decoder
==
nullptr
)
return
false
;
const
decoder_c
ontrol
&
dc
=
decoder
->
dc
;
const
DecoderC
ontrol
&
dc
=
decoder
->
dc
;
if
(
dc
.
command
==
DecoderCommand
::
NONE
)
return
false
;
...
...
@@ -356,7 +356,7 @@ decoder_data(Decoder &decoder,
const
void
*
data
,
size_t
length
,
uint16_t
kbit_rate
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
DecoderCommand
cmd
;
assert
(
dc
.
state
==
DecoderState
::
DECODE
);
...
...
@@ -464,7 +464,7 @@ DecoderCommand
decoder_tag
(
Decoder
&
decoder
,
InputStream
*
is
,
Tag
&&
tag
)
{
gcc_unused
const
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
gcc_unused
const
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
DecoderCommand
cmd
;
assert
(
dc
.
state
==
DecoderState
::
DECODE
);
...
...
@@ -543,7 +543,7 @@ decoder_replay_gain(Decoder &decoder,
void
decoder_mixramp
(
Decoder
&
decoder
,
MixRampInfo
&&
mix_ramp
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
dc
.
SetMixRamp
(
std
::
move
(
mix_ramp
));
}
src/DecoderControl.cxx
View file @
e699f678
...
...
@@ -26,13 +26,13 @@
#include <assert.h>
decoder_control
::
decoder_c
ontrol
()
DecoderControl
::
DecoderC
ontrol
()
:
state
(
DecoderState
::
STOP
),
command
(
DecoderCommand
::
NONE
),
song
(
nullptr
),
replay_gain_db
(
0
),
replay_gain_prev_db
(
0
)
{}
decoder_control
::~
decoder_c
ontrol
()
DecoderControl
::~
DecoderC
ontrol
()
{
ClearError
();
...
...
@@ -41,7 +41,7 @@ decoder_control::~decoder_control()
}
bool
decoder_c
ontrol
::
IsCurrentSong
(
const
Song
&
_song
)
const
DecoderC
ontrol
::
IsCurrentSong
(
const
Song
&
_song
)
const
{
switch
(
state
)
{
case
DecoderState
:
:
STOP
:
...
...
@@ -58,7 +58,7 @@ decoder_control::IsCurrentSong(const Song &_song) const
}
void
decoder_c
ontrol
::
Start
(
Song
*
_song
,
DecoderC
ontrol
::
Start
(
Song
*
_song
,
unsigned
_start_ms
,
unsigned
_end_ms
,
MusicBuffer
&
_buffer
,
MusicPipe
&
_pipe
)
{
...
...
@@ -78,7 +78,7 @@ decoder_control::Start(Song *_song,
}
void
decoder_c
ontrol
::
Stop
()
DecoderC
ontrol
::
Stop
()
{
Lock
();
...
...
@@ -96,7 +96,7 @@ decoder_control::Stop()
}
bool
decoder_c
ontrol
::
Seek
(
double
where
)
DecoderC
ontrol
::
Seek
(
double
where
)
{
assert
(
state
!=
DecoderState
::
START
);
assert
(
where
>=
0.0
);
...
...
@@ -113,7 +113,7 @@ decoder_control::Seek(double where)
}
void
decoder_c
ontrol
::
Quit
()
DecoderC
ontrol
::
Quit
()
{
assert
(
thread
.
IsDefined
());
...
...
@@ -124,7 +124,7 @@ decoder_control::Quit()
}
void
decoder_c
ontrol
::
CycleMixRamp
()
DecoderC
ontrol
::
CycleMixRamp
()
{
previous_mix_ramp
=
std
::
move
(
mix_ramp
);
mix_ramp
.
Clear
();
...
...
src/DecoderControl.hxx
View file @
e699f678
...
...
@@ -54,7 +54,7 @@ enum class DecoderState : uint8_t {
ERROR
,
};
struct
decoder_c
ontrol
{
struct
DecoderC
ontrol
{
/**
* The handle of the decoder thread.
*/
...
...
@@ -143,8 +143,8 @@ struct decoder_control {
MixRampInfo
mix_ramp
,
previous_mix_ramp
;
decoder_c
ontrol
();
~
decoder_c
ontrol
();
DecoderC
ontrol
();
~
DecoderC
ontrol
();
/**
* Locks the object.
...
...
@@ -170,7 +170,7 @@ struct decoder_control {
}
/**
* Waits for a signal on the #
decoder_c
ontrol object. This function
* Waits for a signal on the #
DecoderC
ontrol object. This function
* is only valid in the decoder thread. The object must be locked
* prior to calling this function.
*/
...
...
@@ -336,8 +336,8 @@ public:
*
* @param song the song to be decoded; the given instance will be
* owned and freed by the decoder
* @param start_ms see #
decoder_c
ontrol
* @param end_ms see #
decoder_c
ontrol
* @param start_ms see #
DecoderC
ontrol
* @param end_ms see #
DecoderC
ontrol
* @param pipe the pipe which receives the decoded chunks (owned by
* the caller)
*/
...
...
src/DecoderInternal.cxx
View file @
e699f678
...
...
@@ -42,7 +42,7 @@ Decoder::~Decoder()
* one.
*/
static
DecoderCommand
need_chunks
(
decoder_c
ontrol
&
dc
,
bool
do_wait
)
need_chunks
(
DecoderC
ontrol
&
dc
,
bool
do_wait
)
{
if
(
dc
.
command
==
DecoderCommand
::
STOP
||
dc
.
command
==
DecoderCommand
::
SEEK
)
...
...
@@ -61,7 +61,7 @@ need_chunks(decoder_control &dc, bool do_wait)
struct
music_chunk
*
decoder_get_chunk
(
Decoder
&
decoder
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
DecoderCommand
cmd
;
if
(
decoder
.
chunk
!=
nullptr
)
...
...
@@ -90,7 +90,7 @@ decoder_get_chunk(Decoder &decoder)
void
decoder_flush_chunk
(
Decoder
&
decoder
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
assert
(
decoder
.
chunk
!=
nullptr
);
...
...
src/DecoderInternal.hxx
View file @
e699f678
...
...
@@ -24,12 +24,12 @@
#include "pcm/PcmConvert.hxx"
#include "ReplayGainInfo.hxx"
struct
decoder_c
ontrol
;
struct
DecoderC
ontrol
;
struct
InputStream
;
struct
Tag
;
struct
Decoder
{
decoder_c
ontrol
&
dc
;
DecoderC
ontrol
&
dc
;
PcmConvert
conv_state
;
...
...
@@ -83,7 +83,7 @@ struct Decoder {
*/
unsigned
replay_gain_serial
;
Decoder
(
decoder_c
ontrol
&
_dc
,
bool
_initial_seek_pending
,
Tag
*
_tag
)
Decoder
(
DecoderC
ontrol
&
_dc
,
bool
_initial_seek_pending
,
Tag
*
_tag
)
:
dc
(
_dc
),
timestamp
(
0
),
initial_seek_pending
(
_initial_seek_pending
),
...
...
src/DecoderThread.cxx
View file @
e699f678
...
...
@@ -44,10 +44,10 @@ static constexpr Domain decoder_thread_domain("decoder_thread");
* Marks the current decoder command as "finished" and notifies the
* player thread.
*
* @param dc the #
decoder_c
ontrol object; must be locked
* @param dc the #
DecoderC
ontrol object; must be locked
*/
static
void
decoder_command_finished_locked
(
decoder_c
ontrol
&
dc
)
decoder_command_finished_locked
(
DecoderC
ontrol
&
dc
)
{
assert
(
dc
.
command
!=
DecoderCommand
::
NONE
);
...
...
@@ -68,7 +68,7 @@ decoder_command_finished_locked(decoder_control &dc)
* received, nullptr on error
*/
static
InputStream
*
decoder_input_stream_open
(
decoder_c
ontrol
&
dc
,
const
char
*
uri
)
decoder_input_stream_open
(
DecoderC
ontrol
&
dc
,
const
char
*
uri
)
{
Error
error
;
...
...
@@ -237,7 +237,7 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
static
bool
decoder_run_stream
(
Decoder
&
decoder
,
const
char
*
uri
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
InputStream
*
input_stream
;
bool
success
;
...
...
@@ -285,7 +285,7 @@ decoder_load_replay_gain(Decoder &decoder, const char *path_fs)
static
bool
decoder_run_file
(
Decoder
&
decoder
,
const
char
*
path_fs
)
{
decoder_c
ontrol
&
dc
=
decoder
.
dc
;
DecoderC
ontrol
&
dc
=
decoder
.
dc
;
const
char
*
suffix
=
uri_get_suffix
(
path_fs
);
const
struct
DecoderPlugin
*
plugin
=
nullptr
;
...
...
@@ -333,7 +333,7 @@ decoder_run_file(Decoder &decoder, const char *path_fs)
}
static
void
decoder_run_song
(
decoder_c
ontrol
&
dc
,
decoder_run_song
(
DecoderC
ontrol
&
dc
,
const
Song
*
song
,
const
char
*
uri
)
{
Decoder
decoder
(
dc
,
dc
.
start_ms
>
0
,
...
...
@@ -376,7 +376,7 @@ decoder_run_song(decoder_control &dc,
}
static
void
decoder_run
(
decoder_c
ontrol
&
dc
)
decoder_run
(
DecoderC
ontrol
&
dc
)
{
dc
.
ClearError
();
...
...
@@ -402,7 +402,7 @@ decoder_run(decoder_control &dc)
static
void
decoder_task
(
void
*
arg
)
{
decoder_control
&
dc
=
*
(
decoder_c
ontrol
*
)
arg
;
DecoderControl
&
dc
=
*
(
DecoderC
ontrol
*
)
arg
;
dc
.
Lock
();
...
...
@@ -436,7 +436,7 @@ decoder_task(void *arg)
}
void
decoder_thread_start
(
decoder_c
ontrol
&
dc
)
decoder_thread_start
(
DecoderC
ontrol
&
dc
)
{
assert
(
!
dc
.
thread
.
IsDefined
());
...
...
src/DecoderThread.hxx
View file @
e699f678
...
...
@@ -20,9 +20,9 @@
#ifndef MPD_DECODER_THREAD_HXX
#define MPD_DECODER_THREAD_HXX
struct
decoder_c
ontrol
;
struct
DecoderC
ontrol
;
void
decoder_thread_start
(
decoder_c
ontrol
&
dc
);
decoder_thread_start
(
DecoderC
ontrol
&
dc
);
#endif
src/PlayerThread.cxx
View file @
e699f678
...
...
@@ -53,7 +53,7 @@ enum class CrossFadeState : int8_t {
class
Player
{
player_control
&
pc
;
decoder_c
ontrol
&
dc
;
DecoderC
ontrol
&
dc
;
MusicBuffer
&
buffer
;
...
...
@@ -130,7 +130,7 @@ class Player {
float
elapsed_time
;
public
:
Player
(
player_control
&
_pc
,
decoder_c
ontrol
&
_dc
,
Player
(
player_control
&
_pc
,
DecoderC
ontrol
&
_dc
,
MusicBuffer
&
_buffer
)
:
pc
(
_pc
),
dc
(
_dc
),
buffer
(
_buffer
),
buffering
(
false
),
...
...
@@ -1095,7 +1095,7 @@ Player::Run()
}
static
void
do_play
(
player_control
&
pc
,
decoder_c
ontrol
&
dc
,
do_play
(
player_control
&
pc
,
DecoderC
ontrol
&
dc
,
MusicBuffer
&
buffer
)
{
Player
player
(
pc
,
dc
,
buffer
);
...
...
@@ -1107,7 +1107,7 @@ player_task(void *arg)
{
player_control
&
pc
=
*
(
player_control
*
)
arg
;
decoder_c
ontrol
dc
;
DecoderC
ontrol
dc
;
decoder_thread_start
(
dc
);
MusicBuffer
buffer
(
pc
.
buffer_chunks
);
...
...
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