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
2e9169de
Commit
2e9169de
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved convState to struct decoder
Since we moved all PCM conversions to decoder_data(), the attribute convState isn't being used anymore by the OutputBuffer code. Move it to struct decoder.
parent
1b845f94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
decoder_api.c
src/decoder_api.c
+6
-4
decoder_internal.h
src/decoder_internal.h
+3
-0
outputBuffer.c
src/outputBuffer.c
+0
-1
outputBuffer.h
src/outputBuffer.h
+1
-2
No files found.
src/decoder_api.c
View file @
2e9169de
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
#include "decoder_
api
.h"
#include "decoder_
internal
.h"
#include "audio.h"
#include "audio.h"
#include "utils.h"
#include "utils.h"
...
@@ -25,12 +25,14 @@
...
@@ -25,12 +25,14 @@
#include "playerData.h"
#include "playerData.h"
#include "gcc.h"
#include "gcc.h"
void
decoder_initialized
(
mpd_unused
struct
decoder
*
decoder
,
void
decoder_initialized
(
struct
decoder
*
decoder
,
const
AudioFormat
*
audio_format
,
const
AudioFormat
*
audio_format
,
float
total_time
)
float
total_time
)
{
{
assert
(
dc
.
state
==
DECODE_STATE_START
);
assert
(
dc
.
state
==
DECODE_STATE_START
);
memset
(
&
decoder
->
conv_state
,
0
,
sizeof
(
decoder
->
conv_state
));
if
(
audio_format
!=
NULL
)
{
if
(
audio_format
!=
NULL
)
{
dc
.
audioFormat
=
*
audio_format
;
dc
.
audioFormat
=
*
audio_format
;
getOutputAudioFormat
(
audio_format
,
getOutputAudioFormat
(
audio_format
,
...
@@ -70,7 +72,7 @@ static int need_chunks(InputStream * inStream, int seekable)
...
@@ -70,7 +72,7 @@ static int need_chunks(InputStream * inStream, int seekable)
return
0
;
return
0
;
}
}
int
decoder_data
(
mpd_unused
struct
decoder
*
decoder
,
InputStream
*
inStream
,
int
decoder_data
(
struct
decoder
*
decoder
,
InputStream
*
inStream
,
int
seekable
,
int
seekable
,
void
*
dataIn
,
size_t
dataInLen
,
void
*
dataIn
,
size_t
dataInLen
,
float
data_time
,
mpd_uint16
bitRate
,
float
data_time
,
mpd_uint16
bitRate
,
...
@@ -98,7 +100,7 @@ int decoder_data(mpd_unused struct decoder *decoder, InputStream * inStream,
...
@@ -98,7 +100,7 @@ int decoder_data(mpd_unused struct decoder *decoder, InputStream * inStream,
data
=
convBuffer
;
data
=
convBuffer
;
datalen
=
pcm_convertAudioFormat
(
&
(
dc
.
audioFormat
),
dataIn
,
datalen
=
pcm_convertAudioFormat
(
&
(
dc
.
audioFormat
),
dataIn
,
dataInLen
,
&
(
ob
.
audioFormat
),
dataInLen
,
&
(
ob
.
audioFormat
),
data
,
&
(
ob
.
convState
)
);
data
,
&
decoder
->
conv_state
);
}
}
if
(
replayGainInfo
!=
NULL
&&
(
replayGainState
!=
REPLAYGAIN_OFF
))
if
(
replayGainInfo
!=
NULL
&&
(
replayGainState
!=
REPLAYGAIN_OFF
))
...
...
src/decoder_internal.h
View file @
2e9169de
...
@@ -20,9 +20,12 @@
...
@@ -20,9 +20,12 @@
#define DECODER_INTERNAL_H
#define DECODER_INTERNAL_H
#include "decoder_api.h"
#include "decoder_api.h"
#include "pcm_utils.h"
struct
decoder
{
struct
decoder
{
InputPlugin
*
plugin
;
InputPlugin
*
plugin
;
ConvState
conv_state
;
};
};
#endif
#endif
src/outputBuffer.c
View file @
2e9169de
...
@@ -25,7 +25,6 @@ void ob_init(unsigned int size, Notify *notify)
...
@@ -25,7 +25,6 @@ void ob_init(unsigned int size, Notify *notify)
{
{
assert
(
size
>
0
);
assert
(
size
>
0
);
memset
(
&
ob
.
convState
,
0
,
sizeof
(
ConvState
));
ob
.
chunks
=
xmalloc
(
size
*
sizeof
(
*
ob
.
chunks
));
ob
.
chunks
=
xmalloc
(
size
*
sizeof
(
*
ob
.
chunks
));
ob
.
size
=
size
;
ob
.
size
=
size
;
ob
.
begin
=
0
;
ob
.
begin
=
0
;
...
...
src/outputBuffer.h
View file @
2e9169de
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#define OUTPUT_BUFFER_H
#define OUTPUT_BUFFER_H
#include "notify.h"
#include "notify.h"
#include "
pcm_utils
.h"
#include "
audio_format
.h"
#define OUTPUT_BUFFER_DC_STOP -1
#define OUTPUT_BUFFER_DC_STOP -1
#define OUTPUT_BUFFER_DC_SEEK -2
#define OUTPUT_BUFFER_DC_SEEK -2
...
@@ -55,7 +55,6 @@ typedef struct _OutputBuffer {
...
@@ -55,7 +55,6 @@ typedef struct _OutputBuffer {
int
lazy
;
int
lazy
;
AudioFormat
audioFormat
;
AudioFormat
audioFormat
;
ConvState
convState
;
Notify
*
notify
;
Notify
*
notify
;
}
OutputBuffer
;
}
OutputBuffer
;
...
...
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