diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-04-12 04:08:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-04-12 04:08:12 +0000 |
commit | 45ebb851f4d0bd136b7c246a6a1b71561a6e5800 (patch) | |
tree | 5200c82fbe3489507fe84cbf2b11645dc4a1ad1b /src/outputBuffer.c | |
parent | 9cf66d0e8a7875026d7009d5df331fabf614ac55 (diff) | |
download | mpd-45ebb851f4d0bd136b7c246a6a1b71561a6e5800.tar.gz mpd-45ebb851f4d0bd136b7c246a6a1b71561a6e5800.tar.xz mpd-45ebb851f4d0bd136b7c246a6a1b71561a6e5800.zip |
Drop metadata updates from HTTP for now (input HTTP, and shout)
It is way more complicated than it should be; and
locking it for thread-safety is too difficult.
[merged r7183 from branches/ew]
git-svn-id: https://svn.musicpd.org/mpd/trunk@7241 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r-- | src/outputBuffer.c | 78 |
1 files changed, 2 insertions, 76 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 7a47a44e7..a42e2f121 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -27,8 +27,6 @@ #include "os_compat.h" static mpd_sint16 currentChunk = -1; -static mpd_sint8 currentMetaChunk = -1; -static mpd_sint8 sendMetaChunk; void initOutputBuffer(OutputBuffer * cb, char *chunks) { @@ -38,35 +36,14 @@ void initOutputBuffer(OutputBuffer * cb, char *chunks) buffered_chunks * CHUNK_SIZE); cb->bitRate = (mpd_uint16 *) (((char *)cb->chunkSize) + buffered_chunks * sizeof(mpd_sint16)); - cb->metaChunk = (mpd_sint8 *) (((char *)cb->bitRate) + - buffered_chunks * - sizeof(mpd_sint16)); - cb->times = - (float *)(((char *)cb->metaChunk) + - buffered_chunks * sizeof(mpd_sint8)); - cb->acceptMetadata = 0; -} - -void clearAllMetaChunkSets(OutputBuffer * cb) -{ - memset(cb->metaChunkSet, 0, BUFFERED_METACHUNKS); + cb->times = (float *)(((char *)cb->bitRate) + + buffered_chunks * sizeof(mpd_sint8)); } void clearOutputBuffer(OutputBuffer * cb) { int currentSet = 1; - cb->end = cb->begin; - - /* be sure to reset metaChunkSets cause we are skipping over audio - * audio chunks, and thus skipping over metadata */ - if (currentChunk >= 0 && sendMetaChunk == 0 && currentMetaChunk >= 0) { - currentSet = cb->metaChunkSet[currentChunk]; - } - clearAllMetaChunkSets(cb); - if (currentChunk >= 0 && sendMetaChunk == 0 && currentMetaChunk >= 0) { - cb->metaChunkSet[currentChunk] = currentSet; - } currentChunk = -1; } @@ -140,11 +117,6 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, currentChunk = cb->end; cb->chunkSize[currentChunk] = 0; - - if (sendMetaChunk) { - cb->metaChunk[currentChunk] = currentMetaChunk; - } else - cb->metaChunk[currentChunk] = -1; cb->bitRate[currentChunk] = bitRate; cb->times[currentChunk] = data_time; } @@ -167,49 +139,3 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, return 0; } -int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) -{ - int nextChunk; - static MpdTag *last; - - if (!cb->acceptMetadata || !tag) { - sendMetaChunk = 0; - if (last) - freeMpdTag(last); - last = NULL; - DEBUG("copyMpdTagToOB: !acceptMetadata || !tag\n"); - return 0; - } - - if (last && mpdTagsAreEqual(last, tag)) { - DEBUG("copyMpdTagToOB: same as last\n"); - return 0; - } - - if (last) - freeMpdTag(last); - last = NULL; - - nextChunk = currentMetaChunk + 1; - if (nextChunk >= BUFFERED_METACHUNKS) - nextChunk = 0; - - if (cb->metaChunkSet[nextChunk]) { - sendMetaChunk = 0; - DEBUG("copyMpdTagToOB: metachunk in use!\n"); - return -1; - } - - sendMetaChunk = 1; - currentMetaChunk = nextChunk; - - last = mpdTagDup(tag); - - copyMpdTagToMetadataChunk(tag, &(cb->metadataChunks[currentMetaChunk])); - - cb->metaChunkSet[nextChunk] = 1; - - DEBUG("copyMpdTagToOB: copiedTag\n"); - - return 0; -} |