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
c5d05ac0
Commit
c5d05ac0
authored
Sep 27, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderCommand: convert to strictly-typed enum
parent
939003c1
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
219 additions
and
223 deletions
+219
-223
DecoderAPI.cxx
src/DecoderAPI.cxx
+25
-25
DecoderAPI.hxx
src/DecoderAPI.hxx
+7
-7
DecoderCommand.hxx
src/DecoderCommand.hxx
+7
-5
DecoderControl.cxx
src/DecoderControl.cxx
+7
-7
DecoderControl.hxx
src/DecoderControl.hxx
+8
-8
DecoderInternal.cxx
src/DecoderInternal.cxx
+6
-6
DecoderThread.cxx
src/DecoderThread.cxx
+12
-12
AdPlugDecoderPlugin.cxx
src/decoder/AdPlugDecoderPlugin.cxx
+2
-2
AudiofileDecoderPlugin.cxx
src/decoder/AudiofileDecoderPlugin.cxx
+4
-4
DsdiffDecoderPlugin.cxx
src/decoder/DsdiffDecoderPlugin.cxx
+5
-6
DsfDecoderPlugin.cxx
src/decoder/DsfDecoderPlugin.cxx
+5
-6
FaadDecoderPlugin.cxx
src/decoder/FaadDecoderPlugin.cxx
+3
-3
FfmpegDecoderPlugin.cxx
src/decoder/FfmpegDecoderPlugin.cxx
+6
-7
FlacCommon.cxx
src/decoder/FlacCommon.cxx
+7
-8
FlacDecoderPlugin.cxx
src/decoder/FlacDecoderPlugin.cxx
+4
-4
FlacInput.cxx
src/decoder/FlacInput.cxx
+4
-4
FluidsynthDecoderPlugin.cxx
src/decoder/FluidsynthDecoderPlugin.cxx
+2
-2
GmeDecoderPlugin.cxx
src/decoder/GmeDecoderPlugin.cxx
+3
-3
MadDecoderPlugin.cxx
src/decoder/MadDecoderPlugin.cxx
+20
-20
MikmodDecoderPlugin.cxx
src/decoder/MikmodDecoderPlugin.cxx
+3
-2
ModplugDecoderPlugin.cxx
src/decoder/ModplugDecoderPlugin.cxx
+3
-3
MpcdecDecoderPlugin.cxx
src/decoder/MpcdecDecoderPlugin.cxx
+4
-4
Mpg123DecoderPlugin.cxx
src/decoder/Mpg123DecoderPlugin.cxx
+4
-4
OpusDecoderPlugin.cxx
src/decoder/OpusDecoderPlugin.cxx
+27
-28
PcmDecoderPlugin.cxx
src/decoder/PcmDecoderPlugin.cxx
+4
-5
SndfileDecoderPlugin.cxx
src/decoder/SndfileDecoderPlugin.cxx
+4
-4
VorbisDecoderPlugin.cxx
src/decoder/VorbisDecoderPlugin.cxx
+5
-6
WavpackDecoderPlugin.cxx
src/decoder/WavpackDecoderPlugin.cxx
+3
-3
WildmidiDecoderPlugin.cxx
src/decoder/WildmidiDecoderPlugin.cxx
+4
-4
sidplay_decoder_plugin.cxx
src/decoder/sidplay_decoder_plugin.cxx
+3
-3
dump_playlist.cxx
test/dump_playlist.cxx
+6
-6
read_tags.cxx
test/read_tags.cxx
+6
-6
run_decoder.cxx
test/run_decoder.cxx
+6
-6
No files found.
src/DecoderAPI.cxx
View file @
c5d05ac0
...
...
@@ -106,7 +106,7 @@ decoder_prepare_initial_seek(struct decoder *decoder)
return
false
;
}
if
(
dc
->
command
==
D
ECODE_COMMAND_
NONE
)
{
if
(
dc
->
command
==
D
ecoderCommand
::
NONE
)
{
/* begin initial seek */
decoder
->
initial_seek_pending
=
false
;
...
...
@@ -129,19 +129,19 @@ decoder_prepare_initial_seek(struct decoder *decoder)
* track.
*/
gcc_pure
static
enum
decoder_c
ommand
static
DecoderC
ommand
decoder_get_virtual_command
(
struct
decoder
*
decoder
)
{
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
assert
(
dc
->
pipe
!=
NULL
);
if
(
decoder_prepare_initial_seek
(
decoder
))
return
D
ECODE_COMMAND_
SEEK
;
return
D
ecoderCommand
::
SEEK
;
return
dc
->
command
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_get_command
(
struct
decoder
*
decoder
)
{
return
decoder_get_virtual_command
(
decoder
);
...
...
@@ -154,9 +154,9 @@ decoder_command_finished(struct decoder *decoder)
dc
->
Lock
();
assert
(
dc
->
command
!=
D
ECODE_COMMAND_
NONE
||
assert
(
dc
->
command
!=
D
ecoderCommand
::
NONE
||
decoder
->
initial_seek_running
);
assert
(
dc
->
command
!=
D
ECODE_COMMAND_
SEEK
||
assert
(
dc
->
command
!=
D
ecoderCommand
::
SEEK
||
decoder
->
initial_seek_running
||
dc
->
seek_error
||
decoder
->
seeking
);
assert
(
dc
->
pipe
!=
NULL
);
...
...
@@ -187,7 +187,7 @@ decoder_command_finished(struct decoder *decoder)
decoder
->
timestamp
=
dc
->
seek_where
;
}
dc
->
command
=
D
ECODE_COMMAND_
NONE
;
dc
->
command
=
D
ecoderCommand
::
NONE
;
dc
->
client_cond
.
signal
();
dc
->
Unlock
();
}
...
...
@@ -201,7 +201,7 @@ double decoder_seek_where(gcc_unused struct decoder * decoder)
if
(
decoder
->
initial_seek_running
)
return
dc
->
start_ms
/
1000.
;
assert
(
dc
->
command
==
D
ECODE_COMMAND_
SEEK
);
assert
(
dc
->
command
==
D
ecoderCommand
::
SEEK
);
decoder
->
seeking
=
true
;
...
...
@@ -221,7 +221,7 @@ void decoder_seek_error(struct decoder * decoder)
return
;
}
assert
(
dc
->
command
==
D
ECODE_COMMAND_
SEEK
);
assert
(
dc
->
command
==
D
ecoderCommand
::
SEEK
);
dc
->
seek_error
=
true
;
decoder
->
seeking
=
false
;
...
...
@@ -241,12 +241,12 @@ decoder_check_cancel_read(const struct decoder *decoder)
return
false
;
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
if
(
dc
->
command
==
D
ECODE_COMMAND_
NONE
)
if
(
dc
->
command
==
D
ecoderCommand
::
NONE
)
return
false
;
/* ignore the SEEK command during initialization, the plugin
should handle that after it has initialized successfully */
if
(
dc
->
command
==
D
ECODE_COMMAND_
SEEK
&&
if
(
dc
->
command
==
D
ecoderCommand
::
SEEK
&&
(
dc
->
state
==
DECODE_STATE_START
||
decoder
->
seeking
))
return
false
;
...
...
@@ -308,7 +308,7 @@ decoder_timestamp(struct decoder *decoder, double t)
* Sends a #tag as-is to the music pipe. Flushes the current chunk
* (decoder.chunk) if there is one.
*/
static
enum
decoder_c
ommand
static
DecoderC
ommand
do_send_tag
(
struct
decoder
*
decoder
,
const
Tag
&
tag
)
{
struct
music_chunk
*
chunk
;
...
...
@@ -324,12 +324,12 @@ do_send_tag(struct decoder *decoder, const Tag &tag)
chunk
=
decoder_get_chunk
(
decoder
);
if
(
chunk
==
NULL
)
{
assert
(
decoder
->
dc
->
command
!=
D
ECODE_COMMAND_
NONE
);
assert
(
decoder
->
dc
->
command
!=
D
ecoderCommand
::
NONE
);
return
decoder
->
dc
->
command
;
}
chunk
->
tag
=
new
Tag
(
tag
);
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
static
bool
...
...
@@ -355,14 +355,14 @@ update_stream_tag(struct decoder *decoder, struct input_stream *is)
return
true
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_data
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
void
*
data
,
size_t
length
,
uint16_t
kbit_rate
)
{
struct
decoder_control
*
dc
=
decoder
->
dc
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
assert
(
dc
->
state
==
DECODE_STATE_DECODE
);
assert
(
dc
->
pipe
!=
NULL
);
...
...
@@ -372,7 +372,7 @@ decoder_data(struct decoder *decoder,
cmd
=
decoder_get_virtual_command
(
decoder
);
dc
->
Unlock
();
if
(
cmd
==
D
ECODE_COMMAND_STOP
||
cmd
==
DECODE_COMMAND_
SEEK
||
if
(
cmd
==
D
ecoderCommand
::
STOP
||
cmd
==
DecoderCommand
::
SEEK
||
length
==
0
)
return
cmd
;
...
...
@@ -389,7 +389,7 @@ decoder_data(struct decoder *decoder,
/* send only the stream tag */
cmd
=
do_send_tag
(
decoder
,
*
decoder
->
stream_tag
);
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
return
cmd
;
}
...
...
@@ -405,7 +405,7 @@ decoder_data(struct decoder *decoder,
playback, since we have no better way to
bail out */
g_warning
(
"%s"
,
error
.
GetMessage
());
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
}
}
...
...
@@ -416,7 +416,7 @@ decoder_data(struct decoder *decoder,
chunk
=
decoder_get_chunk
(
decoder
);
if
(
chunk
==
NULL
)
{
assert
(
dc
->
command
!=
D
ECODE_COMMAND_
NONE
);
assert
(
dc
->
command
!=
D
ecoderCommand
::
NONE
);
return
dc
->
command
;
}
...
...
@@ -459,18 +459,18 @@ decoder_data(struct decoder *decoder,
decoder
->
timestamp
>=
dc
->
end_ms
/
1000.0
)
/* the end of this range has been reached:
stop decoding */
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
}
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_tag
(
gcc_unused
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
Tag
&&
tag
)
{
gcc_unused
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
assert
(
dc
->
state
==
DECODE_STATE_DECODE
);
assert
(
dc
->
pipe
!=
NULL
);
...
...
@@ -490,7 +490,7 @@ decoder_tag(gcc_unused struct decoder *decoder, struct input_stream *is,
/* during initial seek, no music chunk must be created
until seeking is finished; skip the rest of the
function here */
return
D
ECODE_COMMAND_
SEEK
;
return
D
ecoderCommand
::
SEEK
;
/* send tag to music pipe */
...
...
src/DecoderAPI.hxx
View file @
c5d05ac0
...
...
@@ -54,10 +54,10 @@ decoder_initialized(struct decoder *decoder,
* Determines the pending decoder command.
*
* @param decoder the decoder object
* @return the current command, or D
ECODE_COMMAND_
NONE if there is no
* @return the current command, or D
ecoderCommand::
NONE if there is no
* command pending
*/
enum
decoder_c
ommand
DecoderC
ommand
decoder_get_command
(
struct
decoder
*
decoder
);
/**
...
...
@@ -71,7 +71,7 @@ void
decoder_command_finished
(
struct
decoder
*
decoder
);
/**
* Call this when you have received the D
ECODE_COMMAND_
SEEK command.
* Call this when you have received the D
ecoderCommand::
SEEK command.
*
* @param decoder the decoder object
* @return the destination position for the week
...
...
@@ -120,10 +120,10 @@ decoder_timestamp(struct decoder *decoder, double t);
* for the player
* @param data the source buffer
* @param length the number of bytes in the buffer
* @return the current command, or D
ECODE_COMMAND_
NONE if there is no
* @return the current command, or D
ecoderCommand::
NONE if there is no
* command pending
*/
enum
decoder_c
ommand
DecoderC
ommand
decoder_data
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
void
*
data
,
size_t
length
,
uint16_t
kbit_rate
);
...
...
@@ -136,10 +136,10 @@ decoder_data(struct decoder *decoder, struct input_stream *is,
* @param is an input stream which is buffering while we are waiting
* for the player
* @param tag the tag to send
* @return the current command, or D
ECODE_COMMAND_
NONE if there is no
* @return the current command, or D
ecoderCommand::
NONE if there is no
* command pending
*/
enum
decoder_c
ommand
DecoderC
ommand
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
Tag
&&
tag
);
/**
...
...
src/DecoderCommand.hxx
View file @
c5d05ac0
...
...
@@ -20,11 +20,13 @@
#ifndef MPD_DECODER_COMMAND_HXX
#define MPD_DECODER_COMMAND_HXX
enum
decoder_command
{
DECODE_COMMAND_NONE
=
0
,
DECODE_COMMAND_START
,
DECODE_COMMAND_STOP
,
DECODE_COMMAND_SEEK
#include <stdint.h>
enum
class
DecoderCommand
:
uint8_t
{
NONE
=
0
,
START
,
STOP
,
SEEK
};
#endif
src/DecoderControl.cxx
View file @
c5d05ac0
...
...
@@ -30,7 +30,7 @@
decoder_control
::
decoder_control
()
:
thread
(
nullptr
),
state
(
DECODE_STATE_STOP
),
command
(
D
ECODE_COMMAND_
NONE
),
command
(
D
ecoderCommand
::
NONE
),
song
(
nullptr
),
replay_gain_db
(
0
),
replay_gain_prev_db
(
0
),
mixramp_start
(
nullptr
),
mixramp_end
(
nullptr
),
...
...
@@ -84,7 +84,7 @@ decoder_control::Start(Song *_song,
buffer
=
&
_buffer
;
pipe
=
&
_pipe
;
LockSynchronousCommand
(
D
ECODE_COMMAND_
START
);
LockSynchronousCommand
(
D
ecoderCommand
::
START
);
}
void
...
...
@@ -92,15 +92,15 @@ decoder_control::Stop()
{
Lock
();
if
(
command
!=
D
ECODE_COMMAND_
NONE
)
if
(
command
!=
D
ecoderCommand
::
NONE
)
/* Attempt to cancel the current command. If it's too
late and the decoder thread is already executing
the old command, we'll call STOP again in this
function (see below). */
SynchronousCommandLocked
(
D
ECODE_COMMAND_
STOP
);
SynchronousCommandLocked
(
D
ecoderCommand
::
STOP
);
if
(
state
!=
DECODE_STATE_STOP
&&
state
!=
DECODE_STATE_ERROR
)
SynchronousCommandLocked
(
D
ECODE_COMMAND_
STOP
);
SynchronousCommandLocked
(
D
ecoderCommand
::
STOP
);
Unlock
();
}
...
...
@@ -117,7 +117,7 @@ decoder_control::Seek(double where)
seek_where
=
where
;
seek_error
=
false
;
SynchronousCommandLocked
(
D
ECODE_COMMAND_
SEEK
);
SynchronousCommandLocked
(
D
ecoderCommand
::
SEEK
);
return
!
seek_error
;
}
...
...
@@ -128,7 +128,7 @@ decoder_control::Quit()
assert
(
thread
!=
nullptr
);
quit
=
true
;
LockAsynchronousCommand
(
D
ECODE_COMMAND_
STOP
);
LockAsynchronousCommand
(
D
ecoderCommand
::
STOP
);
g_thread_join
(
thread
);
thread
=
nullptr
;
...
...
src/DecoderControl.hxx
View file @
c5d05ac0
...
...
@@ -72,7 +72,7 @@ struct decoder_control {
Cond
client_cond
;
enum
decoder_state
state
;
enum
decoder_c
ommand
command
;
DecoderC
ommand
command
;
/**
* The error that occurred in the decoder thread. This
...
...
@@ -95,7 +95,7 @@ struct decoder_control {
/**
* The song currently being decoded. This attribute is set by
* the player thread, when it sends the #D
ECODE_COMMAND_
START
* the player thread, when it sends the #D
ecoderCommand::
START
* command.
*
* This is a duplicate, and must be freed when this attribute
...
...
@@ -207,7 +207,7 @@ struct decoder_control {
}
bool
HasFailed
()
const
{
assert
(
command
==
D
ECODE_COMMAND_
NONE
);
assert
(
command
==
D
ecoderCommand
::
NONE
);
return
state
==
DECODE_STATE_ERROR
;
}
...
...
@@ -228,7 +228,7 @@ struct decoder_control {
*/
gcc_pure
Error
GetError
()
const
{
assert
(
command
==
D
ECODE_COMMAND_
NONE
);
assert
(
command
==
D
ecoderCommand
::
NONE
);
assert
(
state
!=
DECODE_STATE_ERROR
||
error
.
IsDefined
());
Error
result
;
...
...
@@ -286,7 +286,7 @@ private:
* object.
*/
void
WaitCommandLocked
()
{
while
(
command
!=
D
ECODE_COMMAND_
NONE
)
while
(
command
!=
D
ecoderCommand
::
NONE
)
WaitForDecoder
();
}
...
...
@@ -297,7 +297,7 @@ private:
* To be called from the client thread. Caller must lock the
* object.
*/
void
SynchronousCommandLocked
(
decoder_c
ommand
cmd
)
{
void
SynchronousCommandLocked
(
DecoderC
ommand
cmd
)
{
command
=
cmd
;
Signal
();
WaitCommandLocked
();
...
...
@@ -310,14 +310,14 @@ private:
* To be called from the client thread. This method locks the
* object.
*/
void
LockSynchronousCommand
(
decoder_c
ommand
cmd
)
{
void
LockSynchronousCommand
(
DecoderC
ommand
cmd
)
{
Lock
();
ClearError
();
SynchronousCommandLocked
(
cmd
);
Unlock
();
}
void
LockAsynchronousCommand
(
decoder_c
ommand
cmd
)
{
void
LockAsynchronousCommand
(
DecoderC
ommand
cmd
)
{
Lock
();
command
=
cmd
;
Signal
();
...
...
src/DecoderInternal.cxx
View file @
c5d05ac0
...
...
@@ -41,11 +41,11 @@ decoder::~decoder()
* All chunks are full of decoded data; wait for the player to free
* one.
*/
static
enum
decoder_c
ommand
static
DecoderC
ommand
need_chunks
(
struct
decoder_control
*
dc
,
bool
do_wait
)
{
if
(
dc
->
command
==
D
ECODE_COMMAND_
STOP
||
dc
->
command
==
D
ECODE_COMMAND_
SEEK
)
if
(
dc
->
command
==
D
ecoderCommand
::
STOP
||
dc
->
command
==
D
ecoderCommand
::
SEEK
)
return
dc
->
command
;
if
(
do_wait
)
{
...
...
@@ -55,14 +55,14 @@ need_chunks(struct decoder_control *dc, bool do_wait)
return
dc
->
command
;
}
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
struct
music_chunk
*
decoder_get_chunk
(
struct
decoder
*
decoder
)
{
struct
decoder_control
*
dc
=
decoder
->
dc
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
assert
(
decoder
!=
NULL
);
...
...
@@ -84,7 +84,7 @@ decoder_get_chunk(struct decoder *decoder)
dc
->
Lock
();
cmd
=
need_chunks
(
dc
,
true
);
dc
->
Unlock
();
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
return
NULL
;
}
...
...
src/DecoderThread.cxx
View file @
c5d05ac0
...
...
@@ -52,9 +52,9 @@
static
void
decoder_command_finished_locked
(
struct
decoder_control
*
dc
)
{
assert
(
dc
->
command
!=
D
ECODE_COMMAND_
NONE
);
assert
(
dc
->
command
!=
D
ecoderCommand
::
NONE
);
dc
->
command
=
D
ECODE_COMMAND_
NONE
;
dc
->
command
=
D
ecoderCommand
::
NONE
;
dc
->
client_cond
.
signal
();
}
...
...
@@ -67,7 +67,7 @@ decoder_command_finished_locked(struct decoder_control *dc)
*
* Unlock the decoder before calling this function.
*
* @return an input_stream on success or if #D
ECODE_COMMAND_
STOP is
* @return an input_stream on success or if #D
ecoderCommand::
STOP is
* received, NULL on error
*/
static
struct
input_stream
*
...
...
@@ -90,7 +90,7 @@ decoder_input_stream_open(struct decoder_control *dc, const char *uri)
is
->
Update
();
while
(
!
is
->
ready
&&
dc
->
command
!=
D
ECODE_COMMAND_
STOP
)
{
dc
->
command
!=
D
ecoderCommand
::
STOP
)
{
dc
->
Wait
();
is
->
Update
();
...
...
@@ -124,7 +124,7 @@ decoder_stream_decode(const struct decoder_plugin *plugin,
g_debug
(
"probing plugin %s"
,
plugin
->
name
);
if
(
decoder
->
dc
->
command
==
D
ECODE_COMMAND_
STOP
)
if
(
decoder
->
dc
->
command
==
D
ecoderCommand
::
STOP
)
return
true
;
/* rewind the stream, so each plugin gets a fresh start */
...
...
@@ -157,7 +157,7 @@ decoder_file_decode(const struct decoder_plugin *plugin,
g_debug
(
"probing plugin %s"
,
plugin
->
name
);
if
(
decoder
->
dc
->
command
==
D
ECODE_COMMAND_
STOP
)
if
(
decoder
->
dc
->
command
==
D
ecoderCommand
::
STOP
)
return
true
;
decoder
->
dc
->
Unlock
();
...
...
@@ -286,7 +286,7 @@ decoder_run_stream(struct decoder *decoder, const char *uri)
GSList
*
tried
=
NULL
;
success
=
dc
->
command
==
D
ECODE_COMMAND_
STOP
||
success
=
dc
->
command
==
D
ecoderCommand
::
STOP
||
/* first we try mime types: */
decoder_run_stream_mime_type
(
decoder
,
input_stream
,
&
tried
)
||
/* if that fails, try suffix matching the URL: */
...
...
@@ -455,7 +455,7 @@ decoder_task(gpointer arg)
dc
->
state
==
DECODE_STATE_ERROR
);
switch
(
dc
->
command
)
{
case
D
ECODE_COMMAND_
START
:
case
D
ecoderCommand
:
:
START
:
dc
->
MixRampStart
(
nullptr
);
dc
->
MixRampPrevEnd
(
dc
->
mixramp_end
);
dc
->
mixramp_end
=
NULL
;
/* Don't free, it's copied above. */
...
...
@@ -464,19 +464,19 @@ decoder_task(gpointer arg)
/* fall through */
case
D
ECODE_COMMAND_
SEEK
:
case
D
ecoderCommand
:
:
SEEK
:
decoder_run
(
dc
);
break
;
case
D
ECODE_COMMAND_
STOP
:
case
D
ecoderCommand
:
:
STOP
:
decoder_command_finished_locked
(
dc
);
break
;
case
D
ECODE_COMMAND_
NONE
:
case
D
ecoderCommand
:
:
NONE
:
dc
->
Wait
();
break
;
}
}
while
(
dc
->
command
!=
D
ECODE_COMMAND_
NONE
||
!
dc
->
quit
);
}
while
(
dc
->
command
!=
D
ecoderCommand
::
NONE
||
!
dc
->
quit
);
dc
->
Unlock
();
...
...
src/decoder/AdPlugDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -68,7 +68,7 @@ adplug_file_decode(struct decoder *decoder, const char *path_fs)
int16_t
buffer
[
2048
];
const
unsigned
frames_per_buffer
=
G_N_ELEMENTS
(
buffer
)
/
2
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
do
{
if
(
!
player
->
update
())
...
...
@@ -78,7 +78,7 @@ adplug_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
NULL
,
buffer
,
sizeof
(
buffer
),
0
);
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
delete
player
;
}
...
...
src/decoder/AudiofileDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -166,7 +166,6 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
uint16_t
bit_rate
;
int
ret
;
char
chunk
[
CHUNK_SIZE
];
enum
decoder_command
cmd
;
if
(
!
is
->
IsSeekable
())
{
g_warning
(
"not seekable"
);
...
...
@@ -202,6 +201,7 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_initialized
(
decoder
,
audio_format
,
true
,
total_time
);
DecoderCommand
cmd
;
do
{
ret
=
afReadFrames
(
af_fp
,
AF_DEFAULT_TRACK
,
chunk
,
CHUNK_SIZE
/
fs
);
...
...
@@ -212,15 +212,15 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
chunk
,
ret
*
fs
,
bit_rate
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
AFframecount
frame
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
afSeekFrame
(
af_fp
,
AF_DEFAULT_TRACK
,
frame
);
decoder_command_finished
(
decoder
);
cmd
=
D
ECODE_COMMAND_
NONE
;
cmd
=
D
ecoderCommand
::
NONE
;
}
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
afCloseFile
(
af_fp
);
}
...
...
src/decoder/DsdiffDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -403,17 +403,16 @@ dsdiff_decode_chunk(struct decoder *decoder, struct input_stream *is,
if
(
lsbitfirst
)
bit_reverse_buffer
(
buffer
,
buffer
+
nbytes
);
enum
decoder_command
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
);
const
auto
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
);
switch
(
cmd
)
{
case
D
ECODE_COMMAND_
NONE
:
case
D
ecoderCommand
:
:
NONE
:
break
;
case
D
ECODE_COMMAND_
START
:
case
D
ECODE_COMMAND_
STOP
:
case
D
ecoderCommand
:
:
START
:
case
D
ecoderCommand
:
:
STOP
:
return
false
;
case
D
ECODE_COMMAND_
SEEK
:
case
D
ecoderCommand
:
:
SEEK
:
/* Not implemented yet */
decoder_seek_error
(
decoder
);
...
...
src/decoder/DsfDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -258,17 +258,16 @@ dsf_decode_chunk(struct decoder *decoder, struct input_stream *is,
dsf_to_pcm_order
(
buffer
,
dsf_scratch_buffer
,
nbytes
);
enum
decoder_command
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
);
const
auto
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
);
switch
(
cmd
)
{
case
D
ECODE_COMMAND_
NONE
:
case
D
ecoderCommand
:
:
NONE
:
break
;
case
D
ECODE_COMMAND_
START
:
case
D
ECODE_COMMAND_
STOP
:
case
D
ecoderCommand
:
:
START
:
case
D
ecoderCommand
:
:
STOP
:
return
false
;
case
D
ECODE_COMMAND_
SEEK
:
case
D
ecoderCommand
:
:
SEEK
:
/* not implemented yet */
decoder_seek_error
(
decoder
);
...
...
src/decoder/FaadDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -368,7 +368,6 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
bool
ret
;
uint16_t
bit_rate
=
0
;
DecoderBuffer
*
buffer
;
enum
decoder_command
cmd
;
buffer
=
decoder_buffer_new
(
mpd_decoder
,
is
,
FAAD_MIN_STREAMSIZE
*
AAC_MAX_CHANNELS
);
...
...
@@ -386,7 +385,7 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
NeAACDecSetConfiguration
(
decoder
,
config
);
while
(
!
decoder_buffer_is_full
(
buffer
)
&&
!
is
->
LockIsEOF
()
&&
decoder_get_command
(
mpd_decoder
)
==
D
ECODE_COMMAND_
NONE
)
{
decoder_get_command
(
mpd_decoder
)
==
D
ecoderCommand
::
NONE
)
{
adts_find_frame
(
buffer
);
decoder_buffer_fill
(
buffer
);
}
...
...
@@ -407,6 +406,7 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
/* the decoder loop */
DecoderCommand
cmd
;
do
{
size_t
frame_size
;
const
void
*
decoded
;
...
...
@@ -457,7 +457,7 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
cmd
=
decoder_data
(
mpd_decoder
,
is
,
decoded
,
(
size_t
)
frame_info
.
samples
*
2
,
bit_rate
);
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
/* cleanup */
...
...
src/decoder/FfmpegDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -253,7 +253,7 @@ copy_interleave_frame(const AVCodecContext *codec_context,
return
data_size
;
}
static
enum
decoder_c
ommand
static
DecoderC
ommand
ffmpeg_send_packet
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
AVPacket
*
packet
,
AVCodecContext
*
codec_context
,
...
...
@@ -269,9 +269,8 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
uint8_t
*
output_buffer
;
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
while
(
packet2
.
size
>
0
&&
cmd
==
DECODE_COMMAND_NONE
)
{
DecoderCommand
cmd
=
DecoderCommand
::
NONE
;
while
(
packet2
.
size
>
0
&&
cmd
==
DecoderCommand
::
NONE
)
{
int
audio_size
=
0
;
int
got_frame
=
0
;
int
len
=
avcodec_decode_audio4
(
codec_context
,
...
...
@@ -470,7 +469,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
uint8_t
*
interleaved_buffer
=
NULL
;
int
interleaved_buffer_size
=
0
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
do
{
AVPacket
packet
;
if
(
av_read_frame
(
format_context
,
&
packet
)
<
0
)
...
...
@@ -488,7 +487,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
av_free_packet
(
&
packet
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
int64_t
where
=
time_to_ffmpeg
(
decoder_seek_where
(
decoder
),
av_stream
->
time_base
);
...
...
@@ -501,7 +500,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
decoder_command_finished
(
decoder
);
}
}
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
avcodec_free_frame
(
&
frame
);
...
...
src/decoder/FlacCommon.cxx
View file @
c5d05ac0
...
...
@@ -158,7 +158,6 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
const
FLAC__int32
*
const
buf
[],
FLAC__uint64
nbytes
)
{
enum
decoder_command
cmd
;
void
*
buffer
;
unsigned
bit_rate
;
...
...
@@ -178,19 +177,19 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
else
bit_rate
=
0
;
cmd
=
decoder_data
(
data
->
decoder
,
data
->
input_stream
,
buffer
,
buffer_size
,
bit_rate
);
auto
cmd
=
decoder_data
(
data
->
decoder
,
data
->
input_stream
,
buffer
,
buffer_size
,
bit_rate
);
data
->
next_frame
+=
frame
->
header
.
blocksize
;
switch
(
cmd
)
{
case
D
ECODE_COMMAND_
NONE
:
case
D
ECODE_COMMAND_
START
:
case
D
ecoderCommand
:
:
NONE
:
case
D
ecoderCommand
:
:
START
:
break
;
case
D
ECODE_COMMAND_
STOP
:
case
D
ecoderCommand
:
:
STOP
:
return
FLAC__STREAM_DECODER_WRITE_STATUS_ABORT
;
case
D
ECODE_COMMAND_
SEEK
:
case
D
ecoderCommand
:
:
SEEK
:
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
}
...
...
src/decoder/FlacDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -168,11 +168,11 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
FLAC__uint64
t_start
,
FLAC__uint64
t_end
)
{
struct
decoder
*
decoder
=
data
->
decoder
;
enum
decoder_command
cmd
;
data
->
first_frame
=
t_start
;
while
(
true
)
{
DecoderCommand
cmd
;
if
(
!
data
->
tag
.
IsEmpty
())
{
cmd
=
decoder_tag
(
data
->
decoder
,
data
->
input_stream
,
std
::
move
(
data
->
tag
));
...
...
@@ -180,7 +180,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
}
else
cmd
=
decoder_get_command
(
decoder
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
FLAC__uint64
seek_sample
=
t_start
+
decoder_seek_where
(
decoder
)
*
data
->
audio_format
.
sample_rate
;
...
...
@@ -192,7 +192,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
decoder_command_finished
(
decoder
);
}
else
decoder_seek_error
(
decoder
);
}
else
if
(
cmd
==
D
ECODE_COMMAND_
STOP
||
}
else
if
(
cmd
==
D
ecoderCommand
::
STOP
||
FLAC__stream_decoder_get_state
(
flac_dec
)
==
FLAC__STREAM_DECODER_END_OF_STREAM
)
break
;
...
...
@@ -201,7 +201,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
break
;
if
(
!
FLAC__stream_decoder_process_single
(
flac_dec
)
&&
decoder_get_command
(
decoder
)
==
D
ECODE_COMMAND_
NONE
)
{
decoder_get_command
(
decoder
)
==
D
ecoderCommand
::
NONE
)
{
/* a failure that was not triggered by a
decoder command */
flacPrintErroredState
(
FLAC__stream_decoder_get_state
(
flac_dec
));
...
...
src/decoder/FlacInput.cxx
View file @
c5d05ac0
...
...
@@ -33,7 +33,7 @@ FlacInput::Read(FLAC__byte buffer[], size_t *bytes)
if
(
r
==
0
)
{
if
(
input_stream
->
LockIsEOF
()
||
(
decoder
!=
nullptr
&&
decoder_get_command
(
decoder
)
!=
D
ECODE_COMMAND_
NONE
))
decoder_get_command
(
decoder
)
!=
D
ecoderCommand
::
NONE
))
return
FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM
;
else
return
FLAC__STREAM_DECODER_READ_STATUS_ABORT
;
...
...
@@ -79,8 +79,8 @@ FLAC__bool
FlacInput
::
Eof
()
{
return
(
decoder
!=
nullptr
&&
decoder_get_command
(
decoder
)
!=
D
ECODE_COMMAND_
NONE
&&
decoder_get_command
(
decoder
)
!=
D
ECODE_COMMAND_
SEEK
)
||
decoder_get_command
(
decoder
)
!=
D
ecoderCommand
::
NONE
&&
decoder_get_command
(
decoder
)
!=
D
ecoderCommand
::
SEEK
)
||
input_stream
->
LockIsEOF
();
}
...
...
@@ -88,7 +88,7 @@ void
FlacInput
::
Error
(
FLAC__StreamDecoderErrorStatus
status
)
{
if
(
decoder
==
nullptr
||
decoder_get_command
(
decoder
)
!=
D
ECODE_COMMAND_
STOP
)
decoder_get_command
(
decoder
)
!=
D
ecoderCommand
::
STOP
)
g_warning
(
"%s"
,
FLAC__StreamDecoderErrorStatusString
[
status
]);
}
...
...
src/decoder/FluidsynthDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -102,7 +102,6 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
fluid_synth_t
*
synth
;
fluid_player_t
*
player
;
int
ret
;
enum
decoder_command
cmd
;
/* set up fluid settings */
...
...
@@ -167,6 +166,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
const
AudioFormat
audio_format
(
sample_rate
,
SampleFormat
::
S16
,
2
);
decoder_initialized
(
decoder
,
audio_format
,
false
,
-
1
);
DecoderCommand
cmd
;
while
(
fluid_player_get_status
(
player
)
==
FLUID_PLAYER_PLAYING
)
{
int16_t
buffer
[
2048
];
const
unsigned
max_frames
=
G_N_ELEMENTS
(
buffer
)
/
2
;
...
...
@@ -182,7 +182,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
nullptr
,
buffer
,
sizeof
(
buffer
),
0
);
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
break
;
}
...
...
src/decoder/GmeDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -174,7 +174,7 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
gme_set_fade
(
emu
,
ti
->
length
);
/* play */
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
do
{
short
buf
[
GME_BUFFER_SAMPLES
];
gme_err
=
gme_play
(
emu
,
GME_BUFFER_SAMPLES
,
buf
);
...
...
@@ -184,7 +184,7 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
}
cmd
=
decoder_data
(
decoder
,
nullptr
,
buf
,
sizeof
(
buf
),
0
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
float
where
=
decoder_seek_where
(
decoder
);
gme_err
=
gme_seek
(
emu
,
int
(
where
*
1000
));
if
(
gme_err
!=
nullptr
)
...
...
@@ -194,7 +194,7 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
if
(
gme_track_ended
(
emu
))
break
;
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
gme_free_info
(
ti
);
gme_delete
(
emu
);
...
...
src/decoder/MadDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -171,13 +171,13 @@ struct MadDecoder {
/**
* Sends the synthesized current frame via decoder_data().
*/
enum
decoder_c
ommand
SendPCM
(
unsigned
i
,
unsigned
pcm_length
);
DecoderC
ommand
SendPCM
(
unsigned
i
,
unsigned
pcm_length
);
/**
* Synthesize the current frame and send it via
* decoder_data().
*/
enum
decoder_c
ommand
SyncAndSend
();
DecoderC
ommand
SyncAndSend
();
bool
Read
();
};
...
...
@@ -953,7 +953,7 @@ MadDecoder::UpdateTimerNextFrame()
elapsed_time
=
mad_timer_count
(
timer
,
MAD_UNITS_MILLISECONDS
)
/
1000.0
;
}
enum
decoder_c
ommand
DecoderC
ommand
MadDecoder
::
SendPCM
(
unsigned
i
,
unsigned
pcm_length
)
{
unsigned
max_samples
;
...
...
@@ -963,7 +963,6 @@ MadDecoder::SendPCM(unsigned i, unsigned pcm_length)
MAD_NCHANNELS
(
&
frame
.
header
);
while
(
i
<
pcm_length
)
{
enum
decoder_command
cmd
;
unsigned
int
num_samples
=
pcm_length
-
i
;
if
(
num_samples
>
max_samples
)
num_samples
=
max_samples
;
...
...
@@ -975,17 +974,17 @@ MadDecoder::SendPCM(unsigned i, unsigned pcm_length)
MAD_NCHANNELS
(
&
frame
.
header
));
num_samples
*=
MAD_NCHANNELS
(
&
frame
.
header
);
cmd
=
decoder_data
(
decoder
,
input_stream
,
output_buffer
,
sizeof
(
output_buffer
[
0
])
*
num_samples
,
bit_rate
/
1000
);
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
auto
cmd
=
decoder_data
(
decoder
,
input_stream
,
output_buffer
,
sizeof
(
output_buffer
[
0
])
*
num_samples
,
bit_rate
/
1000
);
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
return
cmd
;
}
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MadDecoder
::
SyncAndSend
()
{
mad_synth_frame
(
&
synth
,
&
frame
);
...
...
@@ -1001,12 +1000,12 @@ MadDecoder::SyncAndSend()
if
(
drop_start_frames
>
0
)
{
drop_start_frames
--
;
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
else
if
((
drop_end_frames
>
0
)
&&
(
current_frame
==
(
max_frames
+
1
-
drop_end_frames
)))
{
/* stop decoding, effectively dropping all remaining
frames */
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
}
unsigned
i
=
0
;
...
...
@@ -1024,28 +1023,29 @@ MadDecoder::SyncAndSend()
pcm_length
-=
drop_end_samples
;
}
enum
decoder_command
cmd
=
SendPCM
(
i
,
pcm_length
);
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
auto
cmd
=
SendPCM
(
i
,
pcm_length
);
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
return
cmd
;
if
(
drop_end_samples
&&
(
current_frame
==
max_frames
-
drop_end_frames
))
/* stop decoding, effectively dropping
* all remaining samples */
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
inline
bool
MadDecoder
::
Read
()
{
enum
mp3_action
ret
;
enum
decoder_command
cmd
;
UpdateTimerNextFrame
();
switch
(
mute_frame
)
{
DecoderCommand
cmd
;
case
MUTEFRAME_SKIP
:
mute_frame
=
MUTEFRAME_NONE
;
break
;
...
...
@@ -1055,7 +1055,7 @@ MadDecoder::Read()
break
;
case
MUTEFRAME_NONE
:
cmd
=
SyncAndSend
();
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
unsigned
long
j
;
assert
(
input_stream
->
IsSeekable
());
...
...
@@ -1072,7 +1072,7 @@ MadDecoder::Read()
mute_frame
=
MUTEFRAME_SEEK
;
decoder_command_finished
(
decoder
);
}
}
else
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
}
else
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
return
false
;
}
...
...
@@ -1119,7 +1119,7 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
if
(
!
data
.
DecodeFirstFrame
(
&
tag
))
{
delete
tag
;
if
(
decoder_get_command
(
decoder
)
==
D
ECODE_COMMAND_
NONE
)
if
(
decoder_get_command
(
decoder
)
==
D
ecoderCommand
::
NONE
)
g_warning
(
"Input does not appear to be a mp3 bit stream.
\n
"
);
return
;
...
...
src/decoder/MikmodDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -148,7 +148,6 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs)
MODULE
*
handle
;
int
ret
;
SBYTE
buffer
[
MIKMOD_FRAME_SIZE
];
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
path2
=
g_strdup
(
path_fs
);
handle
=
Player_Load
(
path2
,
128
,
0
);
...
...
@@ -168,7 +167,9 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs)
decoder_initialized
(
decoder
,
audio_format
,
false
,
0
);
Player_Start
(
handle
);
while
(
cmd
==
DECODE_COMMAND_NONE
&&
Player_Active
())
{
DecoderCommand
cmd
=
DecoderCommand
::
NONE
;
while
(
cmd
==
DecoderCommand
::
NONE
&&
Player_Active
())
{
ret
=
VC_WriteBytes
(
buffer
,
sizeof
(
buffer
));
cmd
=
decoder_data
(
decoder
,
nullptr
,
buffer
,
ret
,
0
);
}
...
...
src/decoder/ModplugDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -99,7 +99,6 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
GByteArray
*
bdatas
;
int
ret
;
char
audio_buffer
[
MODPLUG_FRAME_SIZE
];
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
bdatas
=
mod_loadfile
(
decoder
,
is
);
...
...
@@ -131,6 +130,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
is
->
IsSeekable
(),
ModPlug_GetLength
(
f
)
/
1000.0
);
DecoderCommand
cmd
;
do
{
ret
=
ModPlug_Read
(
f
,
audio_buffer
,
MODPLUG_FRAME_SIZE
);
if
(
ret
<=
0
)
...
...
@@ -140,7 +140,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
audio_buffer
,
ret
,
0
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
float
where
=
decoder_seek_where
(
decoder
);
ModPlug_Seek
(
f
,
(
int
)(
where
*
1000.0
));
...
...
@@ -148,7 +148,7 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
decoder_command_finished
(
decoder
);
}
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
ModPlug_Unload
(
f
);
}
...
...
src/decoder/MpcdecDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -147,7 +147,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
mpc_demux
*
demux
=
mpc_demux_init
(
&
reader
);
if
(
demux
==
nullptr
)
{
if
(
decoder_get_command
(
mpd_decoder
)
!=
D
ECODE_COMMAND_
STOP
)
if
(
decoder_get_command
(
mpd_decoder
)
!=
D
ecoderCommand
::
STOP
)
g_warning
(
"Not a valid musepack stream"
);
return
;
}
...
...
@@ -178,9 +178,9 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
is
->
IsSeekable
(),
mpc_streaminfo_get_length
(
&
info
));
enum
decoder_command
cmd
=
DECODE_COMMAND_
NONE
;
DecoderCommand
cmd
=
DecoderCommand
::
NONE
;
do
{
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
mpc_int64_t
where
=
decoder_seek_where
(
mpd_decoder
)
*
audio_format
.
sample_rate
;
bool
success
;
...
...
@@ -218,7 +218,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
cmd
=
decoder_data
(
mpd_decoder
,
is
,
chunk
,
ret
*
sizeof
(
chunk
[
0
]),
bit_rate
);
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
mpc_demux_exit
(
demux
);
}
...
...
src/decoder/Mpg123DecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -106,7 +106,6 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
mpg123_handle
*
handle
;
int
error
;
off_t
num_samples
;
enum
decoder_command
cmd
;
struct
mpg123_frameinfo
info
;
/* open the file */
...
...
@@ -149,6 +148,7 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
/* the decoder main loop */
DecoderCommand
cmd
;
do
{
unsigned
char
buffer
[
8192
];
size_t
nbytes
;
...
...
@@ -175,7 +175,7 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
nullptr
,
buffer
,
nbytes
,
info
.
bitrate
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
off_t
c
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
c
=
mpg123_seek
(
handle
,
c
,
SEEK_SET
);
if
(
c
<
0
)
...
...
@@ -185,9 +185,9 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
decoder_timestamp
(
decoder
,
c
/
(
double
)
audio_format
.
sample_rate
);
}
cmd
=
D
ECODE_COMMAND_
NONE
;
cmd
=
D
ecoderCommand
::
NONE
;
}
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
/* cleanup */
...
...
src/decoder/OpusDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -96,11 +96,11 @@ public:
bool
ReadFirstPage
(
OggSyncState
&
oy
);
bool
ReadNextPage
(
OggSyncState
&
oy
);
enum
decoder_c
ommand
HandlePackets
();
enum
decoder_c
ommand
HandlePacket
(
const
ogg_packet
&
packet
);
enum
decoder_c
ommand
HandleBOS
(
const
ogg_packet
&
packet
);
enum
decoder_c
ommand
HandleTags
(
const
ogg_packet
&
packet
);
enum
decoder_c
ommand
HandleAudio
(
const
ogg_packet
&
packet
);
DecoderC
ommand
HandlePackets
();
DecoderC
ommand
HandlePacket
(
const
ogg_packet
&
packet
);
DecoderC
ommand
HandleBOS
(
const
ogg_packet
&
packet
);
DecoderC
ommand
HandleTags
(
const
ogg_packet
&
packet
);
DecoderC
ommand
HandleAudio
(
const
ogg_packet
&
packet
);
};
MPDOpusDecoder
::~
MPDOpusDecoder
()
...
...
@@ -143,29 +143,29 @@ MPDOpusDecoder::ReadNextPage(OggSyncState &oy)
return
true
;
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MPDOpusDecoder
::
HandlePackets
()
{
ogg_packet
packet
;
while
(
ogg_stream_packetout
(
&
os
,
&
packet
)
==
1
)
{
enum
decoder_command
cmd
=
HandlePacket
(
packet
);
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
auto
cmd
=
HandlePacket
(
packet
);
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
return
cmd
;
}
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MPDOpusDecoder
::
HandlePacket
(
const
ogg_packet
&
packet
)
{
if
(
packet
.
e_o_s
)
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
if
(
packet
.
b_o_s
)
return
HandleBOS
(
packet
);
else
if
(
!
found_opus
)
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
if
(
IsOpusTags
(
packet
))
return
HandleTags
(
packet
);
...
...
@@ -173,18 +173,18 @@ MPDOpusDecoder::HandlePacket(const ogg_packet &packet)
return
HandleAudio
(
packet
);
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MPDOpusDecoder
::
HandleBOS
(
const
ogg_packet
&
packet
)
{
assert
(
packet
.
b_o_s
);
if
(
found_opus
||
!
IsOpusHead
(
packet
))
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
unsigned
channels
;
if
(
!
ScanOpusHeader
(
packet
.
packet
,
packet
.
bytes
,
channels
)
||
!
audio_valid_channel_count
(
channels
))
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
assert
(
opus_decoder
==
nullptr
);
assert
(
output_buffer
==
nullptr
);
...
...
@@ -201,7 +201,7 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
if
(
opus_decoder
==
nullptr
)
{
g_warning
(
"libopus error: %s"
,
opus_strerror
(
opus_error
));
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
}
const
AudioFormat
audio_format
(
opus_sample_rate
,
...
...
@@ -220,12 +220,12 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
return
decoder_get_command
(
decoder
);
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MPDOpusDecoder
::
HandleTags
(
const
ogg_packet
&
packet
)
{
TagBuilder
tag_builder
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
if
(
ScanOpusTags
(
packet
.
packet
,
packet
.
bytes
,
&
add_tag_handler
,
&
tag_builder
)
&&
!
tag_builder
.
IsEmpty
())
{
...
...
@@ -238,7 +238,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
return
cmd
;
}
inline
enum
decoder_c
ommand
inline
DecoderC
ommand
MPDOpusDecoder
::
HandleAudio
(
const
ogg_packet
&
packet
)
{
assert
(
opus_decoder
!=
nullptr
);
...
...
@@ -250,20 +250,19 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
0
);
if
(
nframes
<
0
)
{
g_warning
(
"%s"
,
opus_strerror
(
nframes
));
return
D
ECODE_COMMAND_
STOP
;
return
D
ecoderCommand
::
STOP
;
}
if
(
nframes
>
0
)
{
const
size_t
nbytes
=
nframes
*
frame_size
;
enum
decoder_command
cmd
=
decoder_data
(
decoder
,
input_stream
,
output_buffer
,
nbytes
,
0
);
if
(
cmd
!=
DECODE_COMMAND_NONE
)
auto
cmd
=
decoder_data
(
decoder
,
input_stream
,
output_buffer
,
nbytes
,
0
);
if
(
cmd
!=
DecoderCommand
::
NONE
)
return
cmd
;
}
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
static
void
...
...
@@ -284,8 +283,8 @@ mpd_opus_stream_decode(struct decoder *decoder,
return
;
while
(
true
)
{
enum
decoder_command
cmd
=
d
.
HandlePackets
();
if
(
cmd
!=
D
ECODE_COMMAND_
NONE
)
auto
cmd
=
d
.
HandlePackets
();
if
(
cmd
!=
D
ecoderCommand
::
NONE
)
break
;
if
(
!
d
.
ReadNextPage
(
oy
))
...
...
src/decoder/PcmDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -48,8 +48,6 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
const
bool
reverse_endian
=
mime
!=
nullptr
&&
strcmp
(
mime
,
"audio/x-mpd-cdda-pcm-reverse"
)
==
0
;
enum
decoder_command
cmd
;
const
double
time_to_size
=
audio_format
.
GetTimeToSize
();
float
total_time
=
-
1
;
...
...
@@ -60,6 +58,7 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_initialized
(
decoder
,
audio_format
,
is
->
IsSeekable
(),
total_time
);
DecoderCommand
cmd
;
do
{
char
buffer
[
4096
];
...
...
@@ -79,7 +78,7 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
?
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
0
)
:
decoder_get_command
(
decoder
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
goffset
offset
=
(
goffset
)(
time_to_size
*
decoder_seek_where
(
decoder
));
...
...
@@ -91,9 +90,9 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_seek_error
(
decoder
);
}
cmd
=
D
ECODE_COMMAND_
NONE
;
cmd
=
D
ecoderCommand
::
NONE
;
}
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
}
static
const
char
*
const
pcm_mime_types
[]
=
{
...
...
src/decoder/SndfileDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -119,7 +119,6 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
size_t
frame_size
;
sf_count_t
read_frames
,
num_frames
;
int
buffer
[
4096
];
enum
decoder_command
cmd
;
info
.
format
=
0
;
...
...
@@ -147,6 +146,7 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
frame_size
=
audio_format
.
GetFrameSize
();
read_frames
=
sizeof
(
buffer
)
/
frame_size
;
DecoderCommand
cmd
;
do
{
num_frames
=
sf_readf_int
(
sf
,
buffer
,
read_frames
);
if
(
num_frames
<=
0
)
...
...
@@ -155,7 +155,7 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
num_frames
*
frame_size
,
0
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
sf_count_t
c
=
time_to_frame
(
decoder_seek_where
(
decoder
),
&
audio_format
);
...
...
@@ -164,9 +164,9 @@ sndfile_stream_decode(struct decoder *decoder, struct input_stream *is)
decoder_seek_error
(
decoder
);
else
decoder_command_finished
(
decoder
);
cmd
=
D
ECODE_COMMAND_
NONE
;
cmd
=
D
ecoderCommand
::
NONE
;
}
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
sf_close
(
sf
);
}
...
...
src/decoder/VorbisDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -83,7 +83,7 @@ static int ogg_seek_cb(void *data, ogg_int64_t offset, int whence)
Error
error
;
return
vis
->
seekable
&&
(
!
vis
->
decoder
||
decoder_get_command
(
vis
->
decoder
)
!=
D
ECODE_COMMAND_
STOP
)
&&
(
!
vis
->
decoder
||
decoder_get_command
(
vis
->
decoder
)
!=
D
ecoderCommand
::
STOP
)
&&
vis
->
input_stream
->
LockSeek
(
offset
,
whence
,
error
)
?
0
:
-
1
;
}
...
...
@@ -143,7 +143,7 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
int
ret
=
ov_open_callbacks
(
vis
,
vf
,
NULL
,
0
,
vorbis_is_callbacks
);
if
(
ret
<
0
)
{
if
(
decoder
==
NULL
||
decoder_get_command
(
decoder
)
==
D
ECODE_COMMAND_
NONE
)
decoder_get_command
(
decoder
)
==
D
ecoderCommand
::
NONE
)
g_warning
(
"Failed to open Ogg Vorbis stream: %s"
,
vorbis_strerror
(
ret
));
return
false
;
...
...
@@ -221,8 +221,6 @@ vorbis_stream_decode(struct decoder *decoder,
decoder_initialized
(
decoder
,
audio_format
,
vis
.
seekable
,
total_time
);
enum
decoder_command
cmd
=
decoder_get_command
(
decoder
);
#ifdef HAVE_TREMOR
char
buffer
[
4096
];
#else
...
...
@@ -235,8 +233,9 @@ vorbis_stream_decode(struct decoder *decoder,
int
prev_section
=
-
1
;
unsigned
kbit_rate
=
0
;
DecoderCommand
cmd
=
decoder_get_command
(
decoder
);
do
{
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
double
seek_where
=
decoder_seek_where
(
decoder
);
if
(
0
==
ov_time_seek_page
(
&
vf
,
seek_where
))
{
decoder_command_finished
(
decoder
);
...
...
@@ -302,7 +301,7 @@ vorbis_stream_decode(struct decoder *decoder,
cmd
=
decoder_data
(
decoder
,
input_stream
,
buffer
,
nbytes
,
kbit_rate
);
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
ov_clear
(
&
vf
);
}
...
...
src/decoder/WavpackDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -177,9 +177,9 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
decoder_initialized
(
decoder
,
audio_format
,
can_seek
,
total_time
);
enum
decoder_c
ommand
cmd
=
decoder_get_command
(
decoder
);
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
)
{
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
DecoderC
ommand
cmd
=
decoder_get_command
(
decoder
);
while
(
cmd
!=
D
ecoderCommand
::
STOP
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
if
(
can_seek
)
{
unsigned
where
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
...
...
src/decoder/WildmidiDecoderPlugin.cxx
View file @
c5d05ac0
...
...
@@ -72,7 +72,6 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs)
};
midi
*
wm
;
const
struct
_WM_Info
*
info
;
enum
decoder_command
cmd
;
wm
=
WildMidi_Open
(
path_fs
);
if
(
wm
==
nullptr
)
...
...
@@ -87,6 +86,7 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs)
decoder_initialized
(
decoder
,
audio_format
,
true
,
info
->
approx_total_samples
/
WILDMIDI_SAMPLE_RATE
);
DecoderCommand
cmd
;
do
{
char
buffer
[
4096
];
int
len
;
...
...
@@ -101,7 +101,7 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
nullptr
,
buffer
,
len
,
0
);
if
(
cmd
==
D
ECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
D
ecoderCommand
::
SEEK
)
{
unsigned
long
seek_where
=
WILDMIDI_SAMPLE_RATE
*
decoder_seek_where
(
decoder
);
...
...
@@ -111,10 +111,10 @@ wildmidi_file_decode(struct decoder *decoder, const char *path_fs)
WildMidi_FastSeek
(
wm
,
&
seek_where
);
#endif
decoder_command_finished
(
decoder
);
cmd
=
D
ECODE_COMMAND_
NONE
;
cmd
=
D
ecoderCommand
::
NONE
;
}
}
while
(
cmd
==
D
ECODE_COMMAND_
NONE
);
}
while
(
cmd
==
D
ecoderCommand
::
NONE
);
WildMidi_Close
(
wm
);
}
...
...
src/decoder/sidplay_decoder_plugin.cxx
View file @
c5d05ac0
...
...
@@ -290,7 +290,7 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs)
const
unsigned
timebase
=
player
.
timebase
();
song_len
*=
timebase
;
enum
decoder_c
ommand
cmd
;
DecoderC
ommand
cmd
;
do
{
char
buffer
[
4096
];
size_t
nbytes
;
...
...
@@ -303,7 +303,7 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
NULL
,
buffer
,
nbytes
,
0
);
if
(
cmd
==
DECODE_COMMAND_
SEEK
)
{
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
unsigned
data_time
=
player
.
time
();
unsigned
target_time
=
(
unsigned
)
(
decoder_seek_where
(
decoder
)
*
timebase
);
...
...
@@ -328,7 +328,7 @@ sidplay_file_decode(struct decoder *decoder, const char *path_fs)
if
(
song_len
>
0
&&
player
.
time
()
>=
(
unsigned
)
song_len
)
break
;
}
while
(
cmd
!=
D
ECODE_COMMAND_
STOP
);
}
while
(
cmd
!=
D
ecoderCommand
::
STOP
);
}
static
bool
...
...
test/dump_playlist.cxx
View file @
c5d05ac0
...
...
@@ -59,10 +59,10 @@ decoder_initialized(gcc_unused struct decoder *decoder,
{
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_get_command
(
gcc_unused
struct
decoder
*
decoder
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
...
...
@@ -96,22 +96,22 @@ decoder_timestamp(gcc_unused struct decoder *decoder,
{
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_data
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
const
void
*
data
,
size_t
datalen
,
gcc_unused
uint16_t
kbit_rate
)
{
gcc_unused
ssize_t
nbytes
=
write
(
1
,
data
,
datalen
);
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_tag
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
gcc_unused
Tag
&&
tag
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
...
...
test/read_tags.cxx
View file @
c5d05ac0
...
...
@@ -47,10 +47,10 @@ decoder_initialized(gcc_unused struct decoder *decoder,
{
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_get_command
(
gcc_unused
struct
decoder
*
decoder
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
decoder_command_finished
(
gcc_unused
struct
decoder
*
decoder
)
...
...
@@ -81,22 +81,22 @@ decoder_timestamp(gcc_unused struct decoder *decoder,
{
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_data
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
const
void
*
data
,
size_t
datalen
,
gcc_unused
uint16_t
bit_rate
)
{
gcc_unused
ssize_t
nbytes
=
write
(
1
,
data
,
datalen
);
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_tag
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
gcc_unused
Tag
&&
tag
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
...
...
test/run_decoder.cxx
View file @
c5d05ac0
...
...
@@ -68,10 +68,10 @@ decoder_initialized(struct decoder *decoder,
decoder
->
initialized
=
true
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_get_command
(
gcc_unused
struct
decoder
*
decoder
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
decoder_command_finished
(
gcc_unused
struct
decoder
*
decoder
)
...
...
@@ -101,22 +101,22 @@ decoder_timestamp(gcc_unused struct decoder *decoder,
{
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_data
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
const
void
*
data
,
size_t
datalen
,
gcc_unused
uint16_t
kbit_rate
)
{
gcc_unused
ssize_t
nbytes
=
write
(
1
,
data
,
datalen
);
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
enum
decoder_c
ommand
DecoderC
ommand
decoder_tag
(
gcc_unused
struct
decoder
*
decoder
,
gcc_unused
struct
input_stream
*
is
,
gcc_unused
Tag
&&
tag
)
{
return
D
ECODE_COMMAND_
NONE
;
return
D
ecoderCommand
::
NONE
;
}
void
...
...
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