aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-11 02:36:25 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-11 02:36:25 +0000
commit4ec3df033954d01663087011efecfca37749f965 (patch)
treeecf4d199b1c4ea3cbbb78c0904a3ba9a4e00efc9 /src/player.c
parent03f02badf02adba317f6358bc0e1ebf669b48204 (diff)
downloadmpd-4ec3df033954d01663087011efecfca37749f965.tar.gz
mpd-4ec3df033954d01663087011efecfca37749f965.tar.xz
mpd-4ec3df033954d01663087011efecfca37749f965.zip
implement saved memory by not storing full path
git-svn-id: https://svn.musicpd.org/mpd/trunk@2601 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/player.c b/src/player.c
index 5b8298970..e398323e8 100644
--- a/src/player.c
+++ b/src/player.c
@@ -179,7 +179,7 @@ int playerPlay(FILE * fp, Song * song) {
copyMpdTagToMetadataChunk(song->tag, &(pc->fileMetadataChunk));
- strncpy(pc->utf8url, song->utf8url, MAXPATHLEN);
+ strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
pc->utf8url[MAXPATHLEN] = '\0';
pc->play = 1;
@@ -324,7 +324,7 @@ int queueSong(Song * song) {
PlayerControl * pc = &(getPlayerData()->playerControl);
if(pc->queueState==PLAYER_QUEUE_BLANK) {
- strncpy(pc->utf8url, song->utf8url, MAXPATHLEN);
+ strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
pc->utf8url[MAXPATHLEN] = '\0';
if(song->tag) pc->fileTime = song->tag->time;
@@ -380,13 +380,13 @@ int playerSeek(FILE * fp, Song * song, float time) {
return -1;
}
- if(strcmp(pc->utf8url, song->utf8url)!=0) {
+ if(strcmp(pc->utf8url, getSongUrl(song))!=0) {
if(song->tag) pc->fileTime = song->tag->time;
else pc->fileTime = 0;
copyMpdTagToMetadataChunk(song->tag, &(pc->fileMetadataChunk));
- strncpy(pc->utf8url, song->utf8url, MAXPATHLEN);
+ strncpy(pc->utf8url, getSongUrl(song), MAXPATHLEN);
pc->utf8url[MAXPATHLEN] = '\0';
}
@@ -476,7 +476,7 @@ Song * playerCurrentDecodeSong() {
memcpy(prev, &(pc->metadataChunk), sizeof(MetadataChunk));
if(song) freeJustSong(song);
song = newNullSong();
- song->utf8url = strdup(pc->currentUrl);
+ song->url = strdup(pc->currentUrl);
song->tag = metadataChunkToMpdTagDup(prev);
ret = song;
resetPlayerMetadata();