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
395281c7
Commit
395281c7
authored
Mar 22, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error reporting for mp4 files
git-svn-id:
https://svn.musicpd.org/mpd/trunk@370
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
80e0fec6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
decode.c
src/decode.c
+10
-10
decode.h
src/decode.h
+1
-0
mp4_decode.c
src/mp4_decode.c
+9
-9
No files found.
src/decode.c
View file @
395281c7
...
...
@@ -116,8 +116,6 @@ int waitOnDecode(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
if
(
dc
->
start
||
dc
->
error
!=
DECODE_ERROR_NOERROR
)
{
strncpy
(
pc
->
erroredFile
,
pc
->
file
,
MAXPATHLEN
);
printf
(
"error: %i, start: %i, decode_pid: %i
\n
"
,
dc
->
error
,
dc
->
start
,
*
decode_pid
);
pc
->
error
=
PLAYER_ERROR_FILE
;
quitDecode
(
pc
,
dc
);
return
-
1
;
...
...
@@ -214,6 +212,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
int
decoderInit
(
PlayerControl
*
pc
,
Buffer
*
cb
,
AudioFormat
*
af
,
DecoderControl
*
dc
)
{
int
pid
;
int
ret
;
decode_pid
=
&
(
pc
->
decode_pid
);
pid
=
fork
();
...
...
@@ -226,36 +225,37 @@ int decoderInit(PlayerControl * pc, Buffer * cb, AudioFormat *af,
switch
(
pc
->
decodeType
)
{
#ifdef HAVE_MAD
case
DECODE_TYPE_MP3
:
dc
->
error
=
mp3_decode
(
cb
,
af
,
dc
);
ret
=
mp3_decode
(
cb
,
af
,
dc
);
break
;
#endif
#ifdef HAVE_FAAD
case
DECODE_TYPE_AAC
:
dc
->
error
=
aac_decode
(
cb
,
af
,
dc
);
ret
=
aac_decode
(
cb
,
af
,
dc
);
break
;
case
DECODE_TYPE_MP4
:
dc
->
error
=
mp4_decode
(
cb
,
af
,
dc
);
ret
=
mp4_decode
(
cb
,
af
,
dc
);
break
;
#endif
#ifdef HAVE_OGG
case
DECODE_TYPE_OGG
:
dc
->
error
=
ogg_decode
(
cb
,
af
,
dc
);
ret
=
ogg_decode
(
cb
,
af
,
dc
);
break
;
#endif
#ifdef HAVE_FLAC
case
DECODE_TYPE_FLAC
:
dc
->
error
=
flac_decode
(
cb
,
af
,
dc
);
ret
=
flac_decode
(
cb
,
af
,
dc
);
break
;
#endif
#ifdef HAVE_AUDIOFILE
case
DECODE_TYPE_AUDIOFILE
:
dc
->
error
=
audiofile_decode
(
cb
,
af
,
dc
);
ret
=
audiofile_decode
(
cb
,
af
,
dc
);
break
;
#endif
default:
dc
->
error
=
DECODE_ERROR_UNKTYPE
;
ret
=
DECODE_ERROR_UNKTYPE
;
}
if
(
dc
->
error
!=
DECODE_ERROR_NOERROR
)
{
if
(
ret
<
0
)
{
dc
->
error
=
DECODE_ERROR_FILE
;
dc
->
start
=
0
;
dc
->
stop
=
0
;
dc
->
state
=
DECODE_STATE_STOP
;
...
...
src/decode.h
View file @
395281c7
...
...
@@ -38,6 +38,7 @@
#define DECODE_ERROR_NOERROR 0
#define DECODE_ERROR_UNKTYPE 1
#define DECODE_ERROR_FILE 2
typedef
struct
_DecoderControl
{
mpd_sint8
state
;
...
...
src/mp4_decode.c
View file @
395281c7
...
...
@@ -223,15 +223,6 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
mp4Buffer
,
mp4BufferSize
);
if
(
dc
->
start
)
{
channels
=
frameInfo
.
channels
;
scale
=
frameInfo
.
samplerate
;
af
->
channels
=
frameInfo
.
channels
;
af
->
sampleRate
=
frameInfo
.
samplerate
;
dc
->
state
=
DECODE_STATE_DECODE
;
dc
->
start
=
0
;
}
if
(
mp4Buffer
)
free
(
mp4Buffer
);
if
(
frameInfo
.
error
>
0
)
{
ERROR
(
"error decoding MP4 file: %s
\n
"
,
dc
->
file
);
...
...
@@ -241,6 +232,15 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
break
;
}
if
(
dc
->
start
)
{
channels
=
frameInfo
.
channels
;
scale
=
frameInfo
.
samplerate
;
af
->
channels
=
frameInfo
.
channels
;
af
->
sampleRate
=
frameInfo
.
samplerate
;
dc
->
state
=
DECODE_STATE_DECODE
;
dc
->
start
=
0
;
}
if
(
channels
*
(
dur
+
offset
)
>
frameInfo
.
samples
)
{
dur
=
frameInfo
.
samples
/
channels
;
offset
=
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