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
cbfcd23d
Commit
cbfcd23d
authored
Mar 19, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug that prevented crosffading/gapless from working for mp4
git-svn-id:
https://svn.musicpd.org/mpd/trunk@282
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
b87cc3c1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
mp4_decode.c
src/mp4_decode.c
+13
-19
player.c
src/player.c
+5
-0
No files found.
src/mp4_decode.c
View file @
cbfcd23d
...
...
@@ -186,10 +186,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
time
=
seekTable
[
sampleId
];
}
if
((
dur
=
mp4ff_get_sample_duration
(
mp4fh
,
track
,
sampleId
))
==
0
)
{
eof
=
1
;
break
;
}
dur
=
mp4ff_get_sample_duration
(
mp4fh
,
track
,
sampleId
);
if
(
sampleId
>
seekTableEnd
)
{
seekTable
[
sampleId
]
=
time
;
...
...
@@ -215,7 +212,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
&
mp4BufferSize
)
==
0
)
{
eof
=
1
;
break
;
continue
;
}
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
mp4Buffer
,
...
...
@@ -238,12 +235,8 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
{
usleep
(
10000
);
}
if
(
dc
->
stop
)
{
eof
=
1
;
break
;
}
else
if
(
dc
->
seek
)
break
;
if
(
dc
->
stop
)
eof
=
1
;
else
if
(
!
dc
->
seek
)
{
sampleBufferLen
-=
size
;
memcpy
(
cb
->
chunks
+
cb
->
end
*
CHUNK_SIZE
+
chunkLen
,
sampleBuffer
,
size
);
...
...
@@ -262,9 +255,10 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
}
}
}
}
if
(
!
dc
->
stop
&&
!
dc
->
seek
&&
chunkLen
)
{
cb
->
chunkSize
[
cb
->
end
]
=
CHUNK_SIZE
;
if
(
!
dc
->
stop
&&
!
dc
->
seek
&&
chunkLen
>
0
)
{
cb
->
chunkSize
[
cb
->
end
]
=
chunkLen
;
++
cb
->
end
;
if
(
cb
->
end
>=
buffered_chunks
)
{
...
...
@@ -274,6 +268,12 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
chunkLen
=
0
;
}
free
(
seekTable
);
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
fclose
(
fh
);
free
(
mp4cb
);
if
(
dc
->
seek
)
dc
->
seek
=
0
;
if
(
dc
->
stop
)
{
...
...
@@ -282,12 +282,6 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
}
else
dc
->
state
=
DECODE_STATE_STOP
;
free
(
seekTable
);
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
fclose
(
fh
);
free
(
mp4cb
);
return
0
;
}
...
...
src/player.c
View file @
cbfcd23d
...
...
@@ -335,6 +335,11 @@ int queueSong(char * utf8file) {
pc
->
decodeType
=
DECODE_TYPE_AUDIOFILE
;
}
#endif
#ifdef HAVE_AUDIOFILE
else
if
(
isMp4
(
utf8file
,
NULL
))
{
pc
->
decodeType
=
DECODE_TYPE_MP4
;
}
#endif
else
return
-
1
;
pc
->
queueState
=
PLAYER_QUEUE_FULL
;
return
0
;
...
...
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