aboutsummaryrefslogtreecommitdiffstats
path: root/src/playerData.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-06 19:41:03 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-06 19:41:03 +0000
commitb29f73c819ff8445b71963d883364e315b7a12d8 (patch)
tree772690e7472972ea3e78bb7b354ff4b903a8e4f3 /src/playerData.c
parent4e53282469de4fea4b8daaec67298bd3394f34bd (diff)
downloadmpd-b29f73c819ff8445b71963d883364e315b7a12d8.tar.gz
mpd-b29f73c819ff8445b71963d883364e315b7a12d8.tar.xz
mpd-b29f73c819ff8445b71963d883364e315b7a12d8.zip
mechanism for updating metadata while decoding
vorbis comments are updated on the fly for streams need to decode icy metadata buffering of metadata needs to be hardened, to ensure that player has already read a particular metachunk or passed over it git-svn-id: https://svn.musicpd.org/mpd/trunk@1358 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/playerData.c')
-rw-r--r--src/playerData.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/playerData.c b/src/playerData.c
index 4950a2c7e..5804f306c 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -73,6 +73,7 @@ void initPlayerData() {
allocationSize+= buffered_chunks*sizeof(float); /*for times*/
allocationSize+= buffered_chunks*sizeof(mpd_sint16); /*for chunkSize*/
allocationSize+= buffered_chunks*sizeof(mpd_sint16); /*for bitRate*/
+ allocationSize+= buffered_chunks*sizeof(mpd_sint8); /*for metaChunk*/
allocationSize+= sizeof(PlayerData); /*for playerData struct*/
if((shmid = shmget(IPC_PRIVATE,allocationSize,IPC_CREAT|0600))<0) {
@@ -95,8 +96,10 @@ void initPlayerData() {
buffered_chunks*CHUNK_SIZE);
buffer->bitRate = (mpd_uint16 *)(((char *)buffer->chunkSize)+
buffered_chunks*sizeof(mpd_sint16));
- buffer->times = (float *)(((char *)buffer->bitRate)+
+ buffer->metaChunk = (mpd_sint8 *)(((char *)buffer->bitRate)+
buffered_chunks*sizeof(mpd_sint16));
+ buffer->times = (float *)(((char *)buffer->metaChunk)+
+ buffered_chunks*sizeof(mpd_sint8));
playerData_pd->playerControl.stop = 0;
playerData_pd->playerControl.pause = 0;
@@ -111,16 +114,10 @@ void initPlayerData() {
memset(playerData_pd->playerControl.utf8url, 0, MAXPATHLEN+1);
memset(playerData_pd->playerControl.erroredUrl, 0, MAXPATHLEN+1);
memset(playerData_pd->playerControl.currentUrl, 0, MAXPATHLEN+1);
- memset(playerData_pd->playerControl.metadata, 0,
- DECODE_METADATA_LENGTH);
playerData_pd->playerControl.crossFade = crossfade;
playerData_pd->playerControl.softwareVolume = 1000;
playerData_pd->playerControl.totalPlayTime = 0;
playerData_pd->playerControl.decode_pid = 0;
- playerData_pd->playerControl.name = -1;
- playerData_pd->playerControl.title = -1;
- playerData_pd->playerControl.artist = -1;
- playerData_pd->playerControl.album = -1;
playerData_pd->playerControl.metadataState =
PLAYER_METADATA_STATE_WRITE;
@@ -130,9 +127,6 @@ void initPlayerData() {
playerData_pd->decoderControl.seek = 0;
playerData_pd->decoderControl.error = DECODE_ERROR_NOERROR;
memset(playerData_pd->decoderControl.utf8url, 0, MAXPATHLEN+1);
-
- memset(playerData_pd->buffer.metadata, 0, DECODE_METADATA_LENGTH);
- playerData_pd->buffer.metadataSet = 0;
}
PlayerData * getPlayerData() {
@@ -142,4 +136,3 @@ PlayerData * getPlayerData() {
void freePlayerData() {
shmdt(playerData_pd);
}
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */