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
c173c746
Commit
c173c746
authored
Jul 03, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix same seeking past end of file issue for mp4, please test DJMario
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1784
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
643d7e77
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+12
-9
No files found.
src/inputPlugins/mp4_plugin.c
View file @
c173c746
...
@@ -112,6 +112,7 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
...
@@ -112,6 +112,7 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
long
offset
;
long
offset
;
mpd_uint16
bitRate
=
0
;
mpd_uint16
bitRate
=
0
;
InputStream
inStream
;
InputStream
inStream
;
int
seeking
=
0
;
if
(
openInputStream
(
&
inStream
,
path
)
<
0
)
{
if
(
openInputStream
(
&
inStream
,
path
)
<
0
)
{
ERROR
(
"failed to open %s
\n
"
,
path
);
ERROR
(
"failed to open %s
\n
"
,
path
);
...
@@ -193,7 +194,9 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
...
@@ -193,7 +194,9 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
seekTable
=
malloc
(
sizeof
(
float
)
*
numSamples
);
seekTable
=
malloc
(
sizeof
(
float
)
*
numSamples
);
for
(
sampleId
=
0
;
sampleId
<
numSamples
&&
!
eof
;
sampleId
++
)
{
for
(
sampleId
=
0
;
sampleId
<
numSamples
&&
!
eof
;
sampleId
++
)
{
if
(
dc
->
seek
&&
seekTableEnd
>
1
&&
if
(
dc
->
seek
)
seeking
=
1
;
if
(
seeking
&&
seekTableEnd
>
1
&&
seekTable
[
seekTableEnd
]
>=
dc
->
seekWhere
)
seekTable
[
seekTableEnd
]
>=
dc
->
seekWhere
)
{
{
int
i
=
2
;
int
i
=
2
;
...
@@ -215,15 +218,16 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
...
@@ -215,15 +218,16 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
else
dur
-=
offset
;
else
dur
-=
offset
;
time
+=
((
float
)
dur
)
/
scale
;
time
+=
((
float
)
dur
)
/
scale
;
if
(
dc
->
seek
&&
time
>
dc
->
seekWhere
)
seekPositionFound
=
1
;
if
(
seeking
&&
time
>
dc
->
seekWhere
)
seekPositionFound
=
1
;
if
(
dc
->
seek
&&
seekPositionFound
)
{
if
(
seeking
&&
seekPositionFound
)
{
seekPositionFound
=
0
;
seekPositionFound
=
0
;
clearOutputBuffer
(
cb
);
clearOutputBuffer
(
cb
);
seeking
=
0
;
dc
->
seek
=
0
;
dc
->
seek
=
0
;
}
}
if
(
dc
->
seek
)
continue
;
if
(
seeking
)
continue
;
if
(
mp4ff_read_sample
(
mp4fh
,
track
,
sampleId
,
&
mp4Buffer
,
if
(
mp4ff_read_sample
(
mp4fh
,
track
,
sampleId
,
&
mp4Buffer
,
&
mp4BufferSize
)
==
0
)
&
mp4BufferSize
)
==
0
)
...
@@ -287,8 +291,6 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
...
@@ -287,8 +291,6 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
}
}
}
}
flushOutputBuffer
(
cb
);
free
(
seekTable
);
free
(
seekTable
);
faacDecClose
(
decoder
);
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
mp4ff_close
(
mp4fh
);
...
@@ -297,10 +299,11 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
...
@@ -297,10 +299,11 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
if
(
dc
->
state
!=
DECODE_STATE_DECODE
)
return
-
1
;
if
(
dc
->
state
!=
DECODE_STATE_DECODE
)
return
-
1
;
/*if(dc->seek
) {
if
(
dc
->
seek
&&
seeking
)
{
dc->seekError = 1
;
clearOutputBuffer
(
cb
)
;
dc
->
seek
=
0
;
dc
->
seek
=
0
;
}*/
}
flushOutputBuffer
(
cb
);
if
(
dc
->
stop
)
{
if
(
dc
->
stop
)
{
dc
->
state
=
DECODE_STATE_STOP
;
dc
->
state
=
DECODE_STATE_STOP
;
...
...
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