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
2e8bd3ae
Commit
2e8bd3ae
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3: always flush directly after decoding/dithering
Since we try to fill the buffer in every iteration, we assume that we should flush the output buffer at the end of each iteration.
parent
af83ac5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+13
-15
No files found.
src/inputPlugins/mp3_plugin.c
View file @
2e8bd3ae
...
...
@@ -933,6 +933,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
}
while
(
i
<
pcm_length
)
{
enum
decoder_command
cmd
;
unsigned
int
num_samples
=
(
data
->
outputBufferEnd
-
data
->
outputPtr
)
/
(
2
*
MAD_NCHANNELS
(
&
(
data
->
frame
).
header
));
...
...
@@ -947,22 +948,19 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
MAD_NCHANNELS
(
&
(
data
->
frame
).
header
));
data
->
outputPtr
+=
2
*
num_samples
;
if
(
data
->
outputPtr
>=
data
->
outputBufferEnd
)
{
enum
decoder_command
cmd
;
cmd
=
decoder_data
(
decoder
,
data
->
inStream
,
data
->
inStream
->
seekable
,
data
->
outputBuffer
,
data
->
outputPtr
-
data
->
outputBuffer
,
data
->
elapsedTime
,
data
->
bitRate
/
1000
,
(
replayGainInfo
!=
NULL
)
?
*
replayGainInfo
:
NULL
);
if
(
cmd
==
DECODE_COMMAND_STOP
)
{
data
->
flush
=
0
;
return
DECODE_BREAK
;
}
data
->
outputPtr
=
data
->
outputBuffer
;
cmd
=
decoder_data
(
decoder
,
data
->
inStream
,
data
->
inStream
->
seekable
,
data
->
outputBuffer
,
data
->
outputPtr
-
data
->
outputBuffer
,
data
->
elapsedTime
,
data
->
bitRate
/
1000
,
(
replayGainInfo
!=
NULL
)
?
*
replayGainInfo
:
NULL
);
if
(
cmd
==
DECODE_COMMAND_STOP
)
{
data
->
flush
=
0
;
return
DECODE_BREAK
;
}
data
->
outputPtr
=
data
->
outputBuffer
;
}
if
(
data
->
dropSamplesAtEnd
&&
...
...
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