aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-31 23:29:35 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-31 23:29:35 +0000
commit1a5b04e4e83640cd0a58d4e49fe755598af73262 (patch)
tree3eef1d5d024b408346edbd8ce2b6f4d695138f22 /src/decode.c
parent5f2c19bfc9e3afc53017e9a76cde0258a5c56388 (diff)
downloadmpd-1a5b04e4e83640cd0a58d4e49fe755598af73262.tar.gz
mpd-1a5b04e4e83640cd0a58d4e49fe755598af73262.tar.xz
mpd-1a5b04e4e83640cd0a58d4e49fe755598af73262.zip
some stream metadata fixes
git-svn-id: https://svn.musicpd.org/mpd/trunk@1266 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index 6c4beeeed..b361b62f3 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -71,6 +71,7 @@ void stopDecode(DecoderControl * dc) {
void quitDecode(PlayerControl * pc, DecoderControl * dc) {
stopDecode(dc);
+ pc->metadataState = PLAYER_METADATA_STATE_READ;
pc->state = PLAYER_STATE_STOP;
dc->seek = 0;
pc->play = 0;
@@ -110,6 +111,15 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
quitDecode(pc,dc); \
return; \
} \
+ if(pc->metadataState == PLAYER_METADATA_STATE_WRITE && \
+ dc->metadataSet) \
+ { \
+ memcpy(pc->metadata, dc->metadata, \
+ DECODE_METADATA_LENGTH); \
+ pc->metadata[DECODE_METADATA_LENGTH-1] = '\0'; \
+ pc->title = dc->title; \
+ } \
+ pc->metadataState = PLAYER_METADATA_STATE_READ; \
pc->totalTime = dc->totalTime; \
pc->sampleRate = dc->audioFormat.sampleRate; \
pc->bits = dc->audioFormat.bits; \
@@ -131,6 +141,9 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb,
int * decodeWaitedOn)
{
+ strncpy(pc->currentUrl, pc->utf8url, MAXPATHLEN);
+ pc->currentUrl[MAXPATHLEN] = '\0';
+
while(decode_pid && *decode_pid>0 && dc->start) my_usleep(10000);
if(dc->start || dc->error!=DECODE_ERROR_NOERROR) {
@@ -570,7 +583,7 @@ void decode() {
dc->seek = 0;
dc->stop = 0;
dc->start = 1;
-
+
if(decode_pid==NULL || *decode_pid<=0) {
if(decoderInit(pc,cb,dc)<0) return;
}