diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-26 02:13:13 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-26 02:13:13 +0000 |
commit | 91c7621376bd127bc91b89300522cb8d09c1c595 (patch) | |
tree | 834f23a741ceee98c8437769b46b3aff11f5d33c /src/decode.c | |
parent | a494bd73d8ca760fba6206e7cbb218fbad83dfd7 (diff) | |
download | mpd-91c7621376bd127bc91b89300522cb8d09c1c595.tar.gz mpd-91c7621376bd127bc91b89300522cb8d09c1c595.tar.xz mpd-91c7621376bd127bc91b89300522cb8d09c1c595.zip |
undo last changes
git-svn-id: https://svn.musicpd.org/mpd/trunk@2345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/decode.c b/src/decode.c index 8cb5e5ea4..148ed02c5 100644 --- a/src/decode.c +++ b/src/decode.c @@ -119,12 +119,6 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) { quitDecode(pc,dc); \ return; \ } \ - { \ - MpdTag * tag = metadataChunkToMpdTagDup( \ - &fileMetadataChunk); \ - sendMetadataToAudioDevice(tag); \ - freeMpdTag(tag); \ - } \ pc->totalTime = dc->totalTime; \ pc->sampleRate = dc->audioFormat.sampleRate; \ pc->bits = dc->audioFormat.bits; \ @@ -147,10 +141,11 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) { } int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, - int * decodeWaitedOn, MetadataChunk * fileMetadataChunk) + int * decodeWaitedOn) { strncpy(pc->currentUrl, pc->utf8url, MAXPATHLEN); pc->currentUrl[MAXPATHLEN] = '\0'; + MpdTag * tag = NULL; while(decode_pid && *decode_pid>0 && dc->start) my_usleep(10000); @@ -162,8 +157,10 @@ int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, return -1; } - memcpy(fileMetadataChunk, &(pc->fileMetadataChunk), - sizeof(MetadataChunk)); + if((tag = metadataChunkToMpdTagDup(&(pc->fileMetadataChunk)))) { + sendMetadataToAudioDevice(tag); + freeMpdTag(tag); + } pc->totalTime = pc->fileTime; pc->bitRate = 0; @@ -176,8 +173,7 @@ int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, } int decodeSeek(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, - int * decodeWaitedOn, int * next, - MetadataChunk * fileMetadataChunk) + int * decodeWaitedOn, int * next) { int ret = -1; @@ -191,8 +187,7 @@ int decodeSeek(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, cb->end = 0; dc->error = 0; dc->start = 1; - waitOnDecode(pc,dc,cb,decodeWaitedOn, - fileMetadataChunk); + waitOnDecode(pc,dc,cb,decodeWaitedOn); } if(*decode_pid>0 && dc->state!=DECODE_STATE_STOP && dc->seekable) @@ -249,9 +244,7 @@ int decodeSeek(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, if(pause) closeAudioDevice(); \ } \ if(pc->seek) { \ - if(decodeSeek(pc,dc,cb,&decodeWaitedOn,&next, \ - &fileMetadataChunk) == 0) \ - { \ + if(decodeSeek(pc,dc,cb,&decodeWaitedOn,&next) == 0) { \ doCrossFade = 0; \ nextChunk = -1; \ bbp = 0; \ @@ -477,14 +470,13 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { double sizeToTime = 0.0; int previousMetadataChunk = -1; MetadataChunk currentMetadataChunk; - MetadataChunk fileMetadataChunk; int currentChunkSent = 1; int end; int next = -1; memset(silence,0,CHUNK_SIZE); - if(waitOnDecode(pc,dc,cb,&decodeWaitedOn,&fileMetadataChunk)<0) return; + if(waitOnDecode(pc,dc,cb,&decodeWaitedOn)<0) return; pc->elapsedTime = 0; pc->state = PLAYER_STATE_PLAY; @@ -635,9 +627,7 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { } else { next = -1; - if(waitOnDecode(pc,dc,cb,&decodeWaitedOn, - &fileMetadataChunk)<0) - { + if(waitOnDecode(pc,dc,cb,&decodeWaitedOn)<0) { return; } nextChunk = -1; |