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
4734a2e2
Commit
4734a2e2
authored
Jun 04, 2007
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding very experimental streaming support for mp4.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@6483
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
cbdc0b15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+10
-16
No files found.
src/inputPlugins/mp4_plugin.c
View file @
4734a2e2
...
...
@@ -88,7 +88,8 @@ static uint32_t mp4_inputStreamSeekCallback(void *inStream, uint64_t position)
return
seekInputStream
((
InputStream
*
)
inStream
,
position
,
SEEK_SET
);
}
static
int
mp4_decode
(
OutputBuffer
*
cb
,
DecoderControl
*
dc
,
char
*
path
)
static
int
mp4_decode
(
OutputBuffer
*
cb
,
DecoderControl
*
dc
,
InputStream
*
inStream
)
{
mp4ff_t
*
mp4fh
;
mp4ff_callback_t
*
mp4cb
;
...
...
@@ -115,24 +116,18 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
int
seekPositionFound
=
0
;
long
offset
;
mpd_uint16
bitRate
=
0
;
InputStream
inStream
;
int
seeking
=
0
;
if
(
openInputStream
(
&
inStream
,
path
)
<
0
)
{
ERROR
(
"failed to open %s
\n
"
,
path
);
return
-
1
;
}
mp4cb
=
xmalloc
(
sizeof
(
mp4ff_callback_t
));
mp4cb
->
read
=
mp4_inputStreamReadCallback
;
mp4cb
->
seek
=
mp4_inputStreamSeekCallback
;
mp4cb
->
user_data
=
&
inStream
;
mp4cb
->
user_data
=
inStream
;
mp4fh
=
mp4ff_open_read
(
mp4cb
);
if
(
!
mp4fh
)
{
ERROR
(
"Input does not appear to be a mp4 stream.
\n
"
);
free
(
mp4cb
);
closeInputStream
(
&
inStream
);
closeInputStream
(
inStream
);
return
-
1
;
}
...
...
@@ -140,7 +135,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
if
(
track
<
0
)
{
ERROR
(
"No AAC track found in mp4 stream.
\n
"
);
mp4ff_close
(
mp4fh
);
closeInputStream
(
&
inStream
);
closeInputStream
(
inStream
);
free
(
mp4cb
);
return
-
1
;
}
...
...
@@ -169,7 +164,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
free
(
mp4cb
);
closeInputStream
(
&
inStream
);
closeInputStream
(
inStream
);
return
-
1
;
}
...
...
@@ -185,7 +180,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
ERROR
(
"Error getting audio format of mp4 AAC track.
\n
"
);
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
closeInputStream
(
&
inStream
);
closeInputStream
(
inStream
);
free
(
mp4cb
);
return
-
1
;
}
...
...
@@ -254,7 +249,6 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
if
(
mp4Buffer
)
free
(
mp4Buffer
);
if
(
frameInfo
.
error
>
0
)
{
ERROR
(
"error decoding MP4 file: %s
\n
"
,
path
);
ERROR
(
"faad2 error: %s
\n
"
,
faacDecGetErrorMessage
(
frameInfo
.
error
));
eof
=
1
;
...
...
@@ -302,7 +296,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
free
(
seekTable
);
faacDecClose
(
decoder
);
mp4ff_close
(
mp4fh
);
closeInputStream
(
&
inStream
);
closeInputStream
(
inStream
);
free
(
mp4cb
);
if
(
dc
->
state
!=
DECODE_STATE_DECODE
)
...
...
@@ -441,10 +435,10 @@ InputPlugin mp4Plugin = {
NULL
,
NULL
,
NULL
,
NULL
,
mp4_decode
,
NULL
,
mp4TagDup
,
INPUT_PLUGIN_STREAM_FILE
,
INPUT_PLUGIN_STREAM_FILE
|
INPUT_PLUGIN_STREAM_URL
,
mp4_suffixes
,
mp4_mimeTypes
};
...
...
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