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
9a7636f5
Commit
9a7636f5
authored
Mar 17, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
have AAC and MP4 types
git-svn-id:
https://svn.musicpd.org/mpd/trunk@267
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
b2b700a8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
4 deletions
+61
-4
decode.h
src/decode.h
+1
-0
ls.c
src/ls.c
+32
-0
ls.h
src/ls.h
+2
-0
player.c
src/player.c
+1
-0
song.c
src/song.c
+6
-0
tag.c
src/tag.c
+18
-4
tag.h
src/tag.h
+1
-0
No files found.
src/decode.h
View file @
9a7636f5
...
...
@@ -27,6 +27,7 @@
#define DECODE_TYPE_FLAC 2
#define DECODE_TYPE_AUDIOFILE 3
#define DECODE_TYPE_AAC 4
#define DECODE_TYPE_MP4 5
#define DECODE_STATE_STOP 0
#define DECODE_STATE_DECODE 1
...
...
src/ls.c
View file @
9a7636f5
...
...
@@ -127,6 +127,7 @@ int isMusic(char * utf8file, time_t * mtime) {
#endif
#ifdef HAVE_FAAD
if
((
ret
=
isAac
(
utf8file
,
mtime
)))
return
ret
;
if
((
ret
=
isMp4
(
utf8file
,
mtime
)))
return
ret
;
#endif
return
ret
;
...
...
@@ -249,6 +250,37 @@ int isOgg(char * utf8file, time_t * mtime) {
return
0
;
}
int
isMp4
(
char
*
utf8file
,
time_t
*
mtime
)
{
struct
stat
st
;
char
*
file
=
utf8ToFsCharset
(
utf8file
);
char
*
actualFile
=
file
;
if
(
actualFile
[
0
]
!=
'/'
)
actualFile
=
rmp2amp
(
file
);
if
(
stat
(
actualFile
,
&
st
)
==
0
)
{
if
(
S_ISREG
(
st
.
st_mode
))
{
char
*
dup
;
char
*
cLast
;
char
*
cNext
;
int
ret
=
0
;
dup
=
strdup
(
file
);
cNext
=
cLast
=
strtok
(
dup
,
"."
);
while
((
cNext
=
strtok
(
NULL
,
"."
)))
cLast
=
cNext
;
if
(
cLast
&&
(
0
==
strcasecmp
(
cLast
,
"m4a"
)
||
0
==
strcasecmp
(
cLast
,
"mp4"
)))
{
if
(
mtime
)
*
mtime
=
st
.
st_mtime
;
ret
=
1
;
}
free
(
dup
);
return
ret
;
}
else
return
0
;
}
return
0
;
}
int
isAac
(
char
*
utf8file
,
time_t
*
mtime
)
{
struct
stat
st
;
char
*
file
=
utf8ToFsCharset
(
utf8file
);
...
...
src/ls.h
View file @
9a7636f5
...
...
@@ -28,6 +28,8 @@ int isMp3(char * utf8file, time_t * mtime);
int
isAac
(
char
*
utf8file
,
time_t
*
mtime
);
int
isMp4
(
char
*
utf8file
,
time_t
*
mtime
);
int
isOgg
(
char
*
utf8file
,
time_t
*
mtime
);
int
isFlac
(
char
*
utf8file
,
time_t
*
mtime
);
...
...
src/player.c
View file @
9a7636f5
...
...
@@ -179,6 +179,7 @@ int playerPlay(FILE * fp, char * utf8file) {
#endif
#ifdef HAVE_FAAD
else
if
(
isAac
(
utf8file
,
NULL
))
pc
->
decodeType
=
DECODE_TYPE_AAC
;
else
if
(
isMp4
(
utf8file
,
NULL
))
pc
->
decodeType
=
DECODE_TYPE_MP4
;
#endif
else
{
strncpy
(
pc
->
erroredFile
,
pc
->
file
,
MAXPATHLEN
);
...
...
src/song.c
View file @
9a7636f5
...
...
@@ -82,6 +82,9 @@ Song * newSong(char * utf8file) {
else
if
(
isAac
(
utf8file
,
&
(
song
->
mtime
)))
{
song
->
tag
=
aacTagDup
(
utf8file
);
}
else
if
(
isMp4
(
utf8file
,
&
(
song
->
mtime
)))
{
song
->
tag
=
mp4TagDup
(
utf8file
);
}
#endif
if
(
!
song
->
tag
||
song
->
tag
->
time
<
0
)
{
...
...
@@ -249,6 +252,9 @@ int updateSongInfo(Song * song) {
else
if
(
isAac
(
utf8file
,
&
(
song
->
mtime
)))
{
song
->
tag
=
aacTagDup
(
utf8file
);
}
else
if
(
isMp4
(
utf8file
,
&
(
song
->
mtime
)))
{
song
->
tag
=
mp4TagDup
(
utf8file
);
}
#endif
if
(
!
song
->
tag
||
song
->
tag
->
time
<
0
)
return
-
1
;
...
...
src/tag.c
View file @
9a7636f5
...
...
@@ -168,13 +168,27 @@ MpdTag * mp3TagDup(char * utf8file) {
#endif
#ifdef HAVE_FAAD
MpdTag
*
aac
TagDup
(
char
*
utf8file
)
{
MpdTag
*
mp4
TagDup
(
char
*
utf8file
)
{
MpdTag
*
ret
=
NULL
;
int
time
;
int
time
=
-
1
;
ret
=
id3Dup
(
utf8file
);
#warning implement mp4 tag parsing, this includes using mp4v2 and id3
#warning getMp4TotalTime needs implementing
//time = getMp4TotalTime(rmp2amp(utf8ToFsCharset(utf8file)));
if
(
time
>=
0
)
{
if
(
!
ret
)
ret
=
newMpdTag
();
ret
->
time
=
time
;
}
return
ret
;
}
MpdTag
*
aacTagDup
(
char
*
utf8file
)
{
MpdTag
*
ret
=
NULL
;
int
time
=
-
1
;
#warning get
Aac
TotalTime needs implementing
#warning get
Mp4
TotalTime needs implementing
//time = getAacTotalTime(rmp2amp(utf8ToFsCharset(utf8file)));
if
(
time
>=
0
)
{
...
...
src/tag.h
View file @
9a7636f5
...
...
@@ -38,6 +38,7 @@ MpdTag * mp3TagDup(char * utf8file);
#endif
#ifdef HAVE_FAAD
MpdTag
*
mp4TagDup
(
char
*
utf8file
);
MpdTag
*
aacTagDup
(
char
*
utf8file
);
#endif
...
...
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