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
aea1ae9b
Commit
aea1ae9b
authored
May 20, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot to clear the mad_stream buffer when doing a seek
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1115
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
e40d39b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
mp3_decode.c
src/mp3_decode.c
+6
-5
No files found.
src/mp3_decode.c
View file @
aea1ae9b
...
...
@@ -137,7 +137,6 @@ typedef struct _mp3DecodeData {
int
flush
;
unsigned
long
bitRate
;
InputStream
*
inStream
;
int
bufferReset
;
}
mp3DecodeData
;
void
initMp3DecodeData
(
mp3DecodeData
*
data
,
InputStream
*
inStream
)
{
...
...
@@ -151,7 +150,6 @@ void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) {
data
->
currentFrame
=
0
;
data
->
flush
=
1
;
data
->
inStream
=
inStream
;
data
->
bufferReset
=
0
;
mad_stream_init
(
&
data
->
stream
);
data
->
stream
.
options
|=
MAD_OPTION_IGNORECRC
;
...
...
@@ -164,7 +162,9 @@ int seekMp3InputBuffer(mp3DecodeData * data, long offset) {
if
(
seekInputStream
(
data
->
inStream
,
offset
,
SEEK_SET
)
<
0
)
{
return
-
1
;
}
data
->
bufferReset
=
1
;
mad_stream_buffer
(
&
data
->
stream
,
data
->
readBuffer
,
0
);
(
data
->
stream
).
error
=
0
;
return
0
;
}
...
...
@@ -175,7 +175,7 @@ int fillMp3InputBuffer(mp3DecodeData * data) {
size_t
readed
;
unsigned
char
*
readStart
;
if
(
!
data
->
bufferReset
&&
(
data
->
stream
).
next_frame
!=
NULL
)
{
if
((
data
->
stream
).
next_frame
!=
NULL
)
{
remaining
=
(
data
->
stream
).
bufend
-
(
data
->
stream
).
next_frame
;
memmove
(
data
->
readBuffer
,(
data
->
stream
).
next_frame
,
remaining
);
readStart
=
(
data
->
readBuffer
)
+
remaining
;
...
...
@@ -185,7 +185,6 @@ int fillMp3InputBuffer(mp3DecodeData * data) {
readSize
=
READ_BUFFER_SIZE
;
readStart
=
data
->
readBuffer
,
remaining
=
0
;
data
->
bufferReset
=
0
;
}
readed
=
readFromInputStream
(
data
->
inStream
,
readStart
,
(
size_t
)
1
,
...
...
@@ -466,6 +465,7 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) {
break
;
case
MUTEFRAME_SEEK
:
if
(
dc
->
seekWhere
<=
data
->
elapsedTime
)
{
data
->
outputPtr
=
data
->
outputBuffer
;
clearOutputBuffer
(
cb
);
dc
->
seekChunk
=
cb
->
end
;
data
->
muteFrame
=
0
;
...
...
@@ -522,6 +522,7 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) {
if
(
seekMp3InputBuffer
(
data
,
data
->
frameOffset
[
i
])
==
0
)
{
data
->
outputPtr
=
data
->
outputBuffer
;
clearOutputBuffer
(
cb
);
dc
->
seekChunk
=
cb
->
end
;
data
->
currentFrame
=
i
;
...
...
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