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
c1fbcd03
Commit
c1fbcd03
authored
May 19, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
todo update and make firstFrame in mp3_decode less blocky!
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1098
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
3e659738
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
TODO
TODO
+20
-8
mp3_decode.c
src/mp3_decode.c
+11
-7
No files found.
TODO
View file @
c1fbcd03
1) play streams
a) for mp3, remember to turn off IGNORECRC for mp3 streams
b) deal with non-blocking in decodeFirstFrame (mp3) better!
c) bufferInput in outputBuffer waiting!
a) make seekings non-blocking:
1) player:
a) first check that seekWhere isn't already buffered
b) if not current song, stop it and play the song to
seek
c) set dc->seek and dc->seekWhere if not already set
and set elapsed time to seekWhere and
then set pc->seek = 0
d) while seeking just continue to play buffer
until seek is done
2) decoder:
a) seek no longer blocks so don't worry about checking
seek in blocking portions, only check stop!
b) yay, less code mess!
b) bufferInput in outputBuffer waiting!
1) implement some sort of callback mechanism for this
for abstraction sake
d
) deal with pausing better
c
) deal with pausing better
1) seekable, on resuming pause, check if we need to reconnect,
jumping to offset
2) if seekable, at some point after init, mark this!
3) if not seekable, reset buffer, and elapsedTime when
unpaused
e
) put some sort of error reporting for streaming/inputStream!
f
) ogg streams
g
) fetch metadata and store in DecoderControl and pass to
d
) put some sort of error reporting for streaming/inputStream!
e
) ogg streams
f
) fetch metadata and store in DecoderControl and pass to
PlayerControl
1) eventually deal with icy-metadata
2) parse metadata on the fly in decoders
h
) command for dealing with the changing metadata, currentsonginfo
g
) command for dealing with the changing metadata, currentsonginfo
or something
2) how to deal with streams and the db
...
...
src/mp3_decode.c
View file @
c1fbcd03
...
...
@@ -332,7 +332,7 @@ fail:
return
0
;
}
int
decodeFirstFrame
(
mp3DecodeData
*
data
)
{
int
decodeFirstFrame
(
mp3DecodeData
*
data
,
DecoderControl
*
dc
)
{
struct
xing
xing
;
int
ret
;
int
skip
;
...
...
@@ -342,10 +342,12 @@ int decodeFirstFrame(mp3DecodeData * data) {
while
(
1
)
{
skip
=
0
;
while
((
ret
=
decodeNextFrameHeader
(
data
))
==
DECODE_CONT
);
while
((
ret
=
decodeNextFrameHeader
(
data
))
==
DECODE_CONT
&&
(
!
dc
||
!
dc
->
stop
));
if
(
ret
==
DECODE_SKIP
)
skip
=
1
;
else
if
(
ret
==
DECODE_BREAK
)
return
-
1
;
while
((
ret
=
decodeNextFrame
(
data
))
==
DECODE_CONT
);
while
((
ret
=
decodeNextFrame
(
data
))
==
DECODE_CONT
&&
(
!
dc
||
!
dc
->
stop
));
if
(
ret
==
DECODE_BREAK
)
return
-
1
;
if
(
!
skip
&&
ret
==
DECODE_OK
)
break
;
}
...
...
@@ -407,16 +409,18 @@ int getMp3TotalTime(char * file) {
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
return
-
1
;
initMp3DecodeData
(
&
data
,
&
inStream
);
if
(
decodeFirstFrame
(
&
data
)
<
0
)
ret
=
-
1
;
if
(
decodeFirstFrame
(
&
data
,
NULL
)
<
0
)
ret
=
-
1
;
else
ret
=
data
.
totalTime
+
0
.
5
;
mp3DecodeDataFinalize
(
&
data
);
return
ret
;
}
int
openMp3FromInputStream
(
InputStream
*
inStream
,
mp3DecodeData
*
data
)
{
int
openMp3FromInputStream
(
InputStream
*
inStream
,
mp3DecodeData
*
data
,
DecoderControl
*
dc
)
{
initMp3DecodeData
(
data
,
inStream
);
if
(
decodeFirstFrame
(
data
)
<
0
)
{
if
(
decodeFirstFrame
(
data
,
dc
)
<
0
)
{
mp3DecodeDataFinalize
(
data
);
return
-
1
;
}
...
...
@@ -550,7 +554,7 @@ void initAudioFormatFromMp3DecodeData(mp3DecodeData * data, AudioFormat * af) {
int
mp3_decode
(
OutputBuffer
*
cb
,
DecoderControl
*
dc
,
InputStream
*
inStream
)
{
mp3DecodeData
data
;
if
(
openMp3FromInputStream
(
inStream
,
&
data
)
<
0
)
{
if
(
openMp3FromInputStream
(
inStream
,
&
data
,
dc
)
<
0
)
{
ERROR
(
"Input does not appear to be a mp3 bit stream.
\n
"
);
closeInputStream
(
inStream
);
return
-
1
;
...
...
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