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
c7384b65
Commit
c7384b65
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminate OUTPUT_BUFFER_DC_STOP, OUTPUT_BUFFER_DC_SEEK
(Ab)use the decoder_command enumeration, which has nearly the same values and the same meaning.
parent
67bf4b44
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
decoder_api.c
src/decoder_api.c
+11
-11
decoder_api.h
src/decoder_api.h
+4
-5
_flac_common.h
src/inputPlugins/_flac_common.h
+1
-1
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+4
-3
outputBuffer.h
src/outputBuffer.h
+0
-3
No files found.
src/decoder_api.c
View file @
c7384b65
...
@@ -82,15 +82,15 @@ void decoder_seek_error(struct decoder * decoder)
...
@@ -82,15 +82,15 @@ void decoder_seek_error(struct decoder * decoder)
* All chunks are full of decoded data; wait for the player to free
* All chunks are full of decoded data; wait for the player to free
* one.
* one.
*/
*/
static
int
need_chunks
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
static
enum
decoder_command
int
seekable
)
need_chunks
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
int
seekable
)
{
{
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
return
OUTPUT_BUFFER_DC
_STOP
;
return
DECODE_COMMAND
_STOP
;
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
{
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
{
if
(
seekable
)
{
if
(
seekable
)
{
return
OUTPUT_BUFFER_DC
_SEEK
;
return
DECODE_COMMAND
_SEEK
;
}
else
{
}
else
{
decoder_seek_error
(
decoder
);
decoder_seek_error
(
decoder
);
}
}
...
@@ -102,14 +102,14 @@ static int need_chunks(struct decoder *decoder, InputStream * inStream,
...
@@ -102,14 +102,14 @@ static int need_chunks(struct decoder *decoder, InputStream * inStream,
notify_signal
(
&
pc
.
notify
);
notify_signal
(
&
pc
.
notify
);
}
}
return
0
;
return
DECODE_COMMAND_NONE
;
}
}
int
decoder_data
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
enum
decoder_command
int
seekable
,
decoder_data
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
int
seekable
,
void
*
dataIn
,
size_t
dataInLen
,
void
*
dataIn
,
size_t
dataInLen
,
float
data_time
,
mpd_uint16
bitRate
,
float
data_time
,
mpd_uint16
bitRate
,
ReplayGainInfo
*
replayGainInfo
)
ReplayGainInfo
*
replayGainInfo
)
{
{
size_t
nbytes
;
size_t
nbytes
;
char
*
data
;
char
*
data
;
...
@@ -153,7 +153,7 @@ int decoder_data(struct decoder *decoder, InputStream * inStream,
...
@@ -153,7 +153,7 @@ int decoder_data(struct decoder *decoder, InputStream * inStream,
}
}
}
}
return
0
;
return
DECODE_COMMAND_NONE
;
}
}
void
decoder_flush
(
mpd_unused
struct
decoder
*
decoder
)
void
decoder_flush
(
mpd_unused
struct
decoder
*
decoder
)
...
...
src/decoder_api.h
View file @
c7384b65
...
@@ -125,11 +125,10 @@ void decoder_seek_error(struct decoder * decoder);
...
@@ -125,11 +125,10 @@ void decoder_seek_error(struct decoder * decoder);
* We send inStream for buffering the inputStream while waiting to
* We send inStream for buffering the inputStream while waiting to
* send the next chunk
* send the next chunk
*/
*/
int
decoder_data
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
enum
decoder_command
int
seekable
,
decoder_data
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
int
seekable
,
void
*
data
,
size_t
datalen
,
void
*
data
,
size_t
datalen
,
float
data_time
,
mpd_uint16
bitRate
,
float
data_time
,
mpd_uint16
bitRate
,
ReplayGainInfo
*
replayGainInfo
);
ReplayGainInfo
*
replayGainInfo
);
void
decoder_flush
(
struct
decoder
*
decoder
);
void
decoder_flush
(
struct
decoder
*
decoder
);
...
...
src/inputPlugins/_flac_common.h
View file @
c7384b65
...
@@ -171,7 +171,7 @@ static inline int flacSendChunk(FlacData * data)
...
@@ -171,7 +171,7 @@ static inline int flacSendChunk(FlacData * data)
1
,
data
->
chunk
,
1
,
data
->
chunk
,
data
->
chunk_length
,
data
->
time
,
data
->
chunk_length
,
data
->
time
,
data
->
bitRate
,
data
->
bitRate
,
data
->
replayGainInfo
)
==
OUTPUT_BUFFER_DC
_STOP
)
data
->
replayGainInfo
)
==
DECODE_COMMAND
_STOP
)
return
-
1
;
return
-
1
;
return
0
;
return
0
;
...
...
src/inputPlugins/mp3_plugin.c
View file @
c7384b65
...
@@ -927,21 +927,22 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
...
@@ -927,21 +927,22 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
}
}
if
(
data
->
outputPtr
>=
data
->
outputBufferEnd
)
{
if
(
data
->
outputPtr
>=
data
->
outputBufferEnd
)
{
ret
=
decoder_data
(
decoder
,
data
->
inStream
,
enum
decoder_command
cmd
;
cmd
=
decoder_data
(
decoder
,
data
->
inStream
,
data
->
inStream
->
seekable
,
data
->
inStream
->
seekable
,
data
->
outputBuffer
,
data
->
outputBuffer
,
data
->
outputPtr
-
data
->
outputBuffer
,
data
->
outputPtr
-
data
->
outputBuffer
,
data
->
elapsedTime
,
data
->
elapsedTime
,
data
->
bitRate
/
1000
,
data
->
bitRate
/
1000
,
(
replayGainInfo
!=
NULL
)
?
*
replayGainInfo
:
NULL
);
(
replayGainInfo
!=
NULL
)
?
*
replayGainInfo
:
NULL
);
if
(
ret
==
OUTPUT_BUFFER_DC
_STOP
)
{
if
(
cmd
==
DECODE_COMMAND
_STOP
)
{
data
->
flush
=
0
;
data
->
flush
=
0
;
return
DECODE_BREAK
;
return
DECODE_BREAK
;
}
}
data
->
outputPtr
=
data
->
outputBuffer
;
data
->
outputPtr
=
data
->
outputBuffer
;
if
(
ret
==
OUTPUT_BUFFER_DC_SEEK
)
if
(
cmd
==
DECODE_COMMAND_STOP
)
break
;
break
;
}
}
}
}
...
...
src/outputBuffer.h
View file @
c7384b65
...
@@ -22,9 +22,6 @@
...
@@ -22,9 +22,6 @@
#include "notify.h"
#include "notify.h"
#include "audio_format.h"
#include "audio_format.h"
#define OUTPUT_BUFFER_DC_STOP -1
#define OUTPUT_BUFFER_DC_SEEK -2
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
#define CHUNK_SIZE 1020
...
...
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