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
3ad41fdd
Commit
3ad41fdd
authored
Jul 15, 2006
by
Avuton Olrich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEANUP] Remove unused code
Cleanup whitespace->tabs git-svn-id:
https://svn.musicpd.org/mpd/trunk@4347
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
be006b86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
24 deletions
+7
-24
song.c
src/song.c
+7
-19
song.h
src/song.h
+0
-2
stats.c
src/stats.c
+0
-3
No files found.
src/song.c
View file @
3ad41fdd
...
...
@@ -63,7 +63,7 @@ Song * newSong(char * url, int type, Directory * parentDir) {
assert
(
type
==
SONG_TYPE_URL
||
parentDir
);
if
(
song
->
type
==
SONG_TYPE_FILE
)
{
InputPlugin
*
plugin
;
InputPlugin
*
plugin
;
unsigned
int
next
=
0
;
char
*
song_url
=
getSongUrl
(
song
);
char
*
abs_path
=
rmp2amp
(
utf8ToFsCharset
(
song_url
));
...
...
@@ -115,7 +115,7 @@ Song * addSongToList(SongList * list, char * url, char * utf8path,
}
if
(
song
==
NULL
)
return
NULL
;
insertInList
(
list
,
song
->
url
,
(
void
*
)
song
);
return
song
;
...
...
@@ -169,7 +169,7 @@ void writeSongInfoFromList(FILE * fp, SongList * list) {
myfprintf
(
fp
,
"%s
\n
"
,
SONG_END
);
}
void
insertSongIntoList
(
SongList
*
list
,
ListNode
**
nextSongNode
,
char
*
key
,
static
void
insertSongIntoList
(
SongList
*
list
,
ListNode
**
nextSongNode
,
char
*
key
,
Song
*
song
)
{
ListNode
*
nodeTemp
;
...
...
@@ -266,7 +266,7 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir) {
exit
(
EXIT_FAILURE
);
}
}
if
(
song
)
{
insertSongIntoList
(
list
,
&
nextSongNode
,
song
->
url
,
song
);
song
=
NULL
;
...
...
@@ -281,7 +281,7 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir) {
int
updateSongInfo
(
Song
*
song
)
{
if
(
song
->
type
==
SONG_TYPE_FILE
)
{
InputPlugin
*
plugin
;
InputPlugin
*
plugin
;
unsigned
int
next
=
0
;
char
*
song_url
=
getSongUrl
(
song
);
char
*
abs_path
=
rmp2amp
(
song_url
);
...
...
@@ -292,26 +292,14 @@ int updateSongInfo(Song * song) {
while
(
!
song
->
tag
&&
(
plugin
=
isMusic
(
song_url
,
&
(
song
->
mtime
),
next
++
)))
{
song
->
tag
=
plugin
->
tagDupFunc
(
abs_path
);
}
song
->
tag
=
plugin
->
tagDupFunc
(
abs_path
);
}
if
(
!
song
->
tag
||
song
->
tag
->
time
<
0
)
return
-
1
;
}
return
0
;
}
Song
*
songDup
(
Song
*
song
)
{
Song
*
ret
=
malloc
(
sizeof
(
Song
));
ret
->
url
=
strdup
(
song
->
url
);
ret
->
mtime
=
song
->
mtime
;
ret
->
tag
=
mpdTagDup
(
song
->
tag
);
ret
->
type
=
song
->
type
;
ret
->
parentDir
=
song
->
parentDir
;
return
ret
;
}
/* pass song = NULL to reset, we do this freeJustSong(), so that if
* we free and recreate this memory we make sure to print it correctly*/
char
*
getSongUrl
(
Song
*
song
)
{
...
...
src/song.h
View file @
3ad41fdd
...
...
@@ -69,8 +69,6 @@ void readSongInfoIntoList(FILE * fp, SongList * list,
int
updateSongInfo
(
Song
*
song
);
Song
*
songDup
(
Song
*
song
);
void
printSongUrl
(
FILE
*
fp
,
Song
*
song
);
char
*
getSongUrl
(
Song
*
song
);
...
...
src/stats.c
View file @
3ad41fdd
...
...
@@ -31,8 +31,6 @@ Stats stats;
void
initStats
()
{
stats
.
daemonStart
=
time
(
NULL
);
stats
.
numberOfSongs
=
0
;
/*stats.playTime = 0;
stats.songsPlayed = 0;*/
}
int
printStats
(
FILE
*
fp
)
{
...
...
@@ -42,7 +40,6 @@ int printStats(FILE * fp) {
myfprintf
(
fp
,
"uptime: %li
\n
"
,
time
(
NULL
)
-
stats
.
daemonStart
);
myfprintf
(
fp
,
"playtime: %li
\n
"
,(
long
)(
getPlayerTotalPlayTime
()
+
0
.
5
));
myfprintf
(
fp
,
"db_playtime: %li
\n
"
,
stats
.
dbPlayTime
);
/*myfprintf(fp,"songs_played: %li\n",stats.songsPlayed);*/
myfprintf
(
fp
,
"db_update: %li
\n
"
,
getDbModTime
());
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