diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-06 16:42:14 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-06 16:42:14 +0000 |
commit | 4e53282469de4fea4b8daaec67298bd3394f34bd (patch) | |
tree | ba8465c48ea1c75983992ba4b265efd1666d9843 /src/outputBuffer.c | |
parent | 926258605a56c015d1421ca5aaf818a8de343afc (diff) | |
download | mpd-4e53282469de4fea4b8daaec67298bd3394f34bd.tar.gz mpd-4e53282469de4fea4b8daaec67298bd3394f34bd.tar.xz mpd-4e53282469de4fea4b8daaec67298bd3394f34bd.zip |
todo update
git-svn-id: https://svn.musicpd.org/mpd/trunk@1352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r-- | src/outputBuffer.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 41932faa5..194e3af8a 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -117,4 +117,33 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, return 0; } -/* vim:set shiftwidth=4 tabstop=8 expandtab: */ + +/* this is stuff for inputPlugins to use! */ +#define copyStringToMetadata(string, element) { \ + if(string && (slen = strlen(string)) && \ + pos < DECODE_METADATA_LENGTH-1) \ + { \ + strncpy(cb->metadata+pos, string, \ + DECODE_METADATA_LENGTH-1-pos); \ + element = pos; \ + pos += slen+1; \ + } \ +} + +void copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) { + int pos = 0; + int slen; + + if(!cb->acceptMetadata) return; + if(!tag) return; + + memset(cb->metadata, 0, DECODE_METADATA_LENGTH); + + copyStringToMetadata(tag->name, cb->name); + copyStringToMetadata(tag->artist, cb->artist); + copyStringToMetadata(tag->title, cb->title); + copyStringToMetadata(tag->album, cb->album); + + cb->metaChunk = cb->end; + cb->metadataSet = 1; +} |