aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2006-07-14 20:34:46 +0000
committerAvuton Olrich <avuton@gmail.com>2006-07-14 20:34:46 +0000
commitb4945959abe26d2cd748417880cc796d97577260 (patch)
treec3f3cd551705cf2b9755a588c24d4543848f9431 /src/player.c
parente4b0fcf8e04d0b598393b07f7bac96548630d8ea (diff)
downloadmpd-b4945959abe26d2cd748417880cc796d97577260.tar.gz
mpd-b4945959abe26d2cd748417880cc796d97577260.tar.xz
mpd-b4945959abe26d2cd748417880cc796d97577260.zip
[CLEANUP] Remove unused function
Remove unused functions from the header, static where possible Cleanup whitespace->tabs git-svn-id: https://svn.musicpd.org/mpd/trunk@4341 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/player.c80
1 files changed, 26 insertions, 54 deletions
diff --git a/src/player.c b/src/player.c
index 54d20c9ae..c7dff3456 100644
--- a/src/player.c
+++ b/src/player.c
@@ -46,11 +46,11 @@
extern int masterPid;
static void resetPlayerMetadata() {
- PlayerControl * pc = &(getPlayerData()->playerControl);
+ PlayerControl * pc = &(getPlayerData()->playerControl);
- if(pc->metadataState == PLAYER_METADATA_STATE_READ) {
- pc->metadataState = PLAYER_METADATA_STATE_WRITE;
- }
+ if(pc->metadataState == PLAYER_METADATA_STATE_READ) {
+ pc->metadataState = PLAYER_METADATA_STATE_WRITE;
+ }
}
void resetPlayer() {
@@ -65,8 +65,8 @@ void resetPlayer() {
getPlayerData()->playerControl.state = PLAYER_STATE_STOP;
getPlayerData()->playerControl.queueState = PLAYER_QUEUE_UNLOCKED;
getPlayerData()->playerControl.seek = 0;
- getPlayerData()->playerControl.metadataState =
- PLAYER_METADATA_STATE_WRITE;
+ getPlayerData()->playerControl.metadataState =
+ PLAYER_METADATA_STATE_WRITE;
pid = getPlayerData()->playerControl.decode_pid;
if(pid>0) kill(pid,SIGTERM);
getPlayerData()->playerControl.decode_pid = 0;
@@ -102,28 +102,16 @@ int playerInit() {
return 0;
}
-int playerInitReal() {
+static int playerInitReal() {
int player_pid;
blockSignals();
player_pid = fork();
if(player_pid==0) {
PlayerControl * pc = &(getPlayerData()->playerControl);
- /* clearUpdatePid(); */
-
unblockSignals();
setSigHandlersForDecoder();
-
- /*
- closeAllListenSockets();
- freeAllInterfaces();
- closeMp3Directory();
- finishPlaylist();
- finishPermissions();
- finishCommands();
- finishVolume();
- */
while(1) {
if(pc->play) decode();
@@ -142,10 +130,10 @@ int playerInitReal() {
pc->queueLockState = PLAYER_QUEUE_UNLOCKED;
pc->unlockQueue = 0;
}
- else if(pc->cycleLogFiles) {
- myfprintfCloseAndOpenLogFile();
- pc->cycleLogFiles = 0;
- }
+ else if(pc->cycleLogFiles) {
+ myfprintfCloseAndOpenLogFile();
+ pc->cycleLogFiles = 0;
+ }
else my_usleep(10000);
}
@@ -173,22 +161,12 @@ int playerPlay(FILE * fp, Song * song) {
if(playerStop(fp)<0) return -1;
- /*{
- struct stat st;
- if(stat(rmp2amp(utf8ToFsCharset(utf8file)),&st)<0) {
- strncpy(pc->erroredFile,pc->file,MAXPATHLEN);
- pc->erroredFile[MAXPATHLEN] = '\0';
- pc->error = PLAYER_ERROR_FILENOTFOUND;
- return 0;
- }
- }*/
-
- if(song->tag) pc->fileTime = song->tag->time;
- else pc->fileTime = 0;
+ if(song->tag) pc->fileTime = song->tag->time;
+ else pc->fileTime = 0;
copyMpdTagToMetadataChunk(song->tag, &(pc->fileMetadataChunk));
- strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
+ strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
pc->utf8url[MAXPATHLEN] = '\0';
pc->play = 1;
@@ -336,8 +314,8 @@ int queueSong(Song * song) {
strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
pc->utf8url[MAXPATHLEN] = '\0';
- if(song->tag) pc->fileTime = song->tag->time;
- else pc->fileTime = 0;
+ if(song->tag) pc->fileTime = song->tag->time;
+ else pc->fileTime = 0;
copyMpdTagToMetadataChunk(song->tag, &(pc->fileMetadataChunk));
@@ -433,12 +411,6 @@ void setPlayerSoftwareVolume(int volume) {
pc->softwareVolume = volume;
}
-int getPlayerSoftwareVolume() {
- PlayerControl * pc = &(getPlayerData()->playerControl);
-
- return pc->softwareVolume;
-}
-
double getPlayerTotalPlayTime() {
PlayerControl * pc = &(getPlayerData()->playerControl);
@@ -473,23 +445,23 @@ void playerCycleLogFiles() {
/* this actually creates a dupe of the current metadata */
Song * playerCurrentDecodeSong() {
- static Song * song = NULL;
- static MetadataChunk * prev = NULL;
+ static Song * song = NULL;
+ static MetadataChunk * prev = NULL;
Song * ret = NULL;
PlayerControl * pc = &(getPlayerData()->playerControl);
if(pc->metadataState == PLAYER_METADATA_STATE_READ) {
DEBUG("playerCurrentDecodeSong: caught new metadata!\n");
- if(prev) free(prev);
- prev = malloc(sizeof(MetadataChunk));
+ if(prev) free(prev);
+ prev = malloc(sizeof(MetadataChunk));
memcpy(prev, &(pc->metadataChunk), sizeof(MetadataChunk));
if(song) freeJustSong(song);
- song = newNullSong();
- song->url = strdup(pc->currentUrl);
+ song = newNullSong();
+ song->url = strdup(pc->currentUrl);
song->tag = metadataChunkToMpdTagDup(prev);
- ret = song;
- resetPlayerMetadata();
- }
+ ret = song;
+ resetPlayerMetadata();
+ }
- return ret;
+ return ret;
}