todo update
git-svn-id: https://svn.musicpd.org/mpd/trunk@1352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
+30
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user