icy metadata! wahoo
still lots some debug code with print out's, so don't bitch about it! git-svn-id: https://svn.musicpd.org/mpd/trunk@1364 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
@@ -531,6 +531,18 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) {
|
||||
default:
|
||||
mad_synth_frame(&data->synth,&data->frame);
|
||||
|
||||
if(data->inStream->metaTitle) {
|
||||
MpdTag * tag = newMpdTag();
|
||||
if(data->inStream->metaName) {
|
||||
tag->name = strdup(data->inStream->metaName);
|
||||
}
|
||||
tag->title = strdup(data->inStream->metaTitle);
|
||||
free(data->inStream->metaTitle);
|
||||
data->inStream->metaTitle = NULL;
|
||||
copyMpdTagToOutputBuffer(cb, tag);
|
||||
freeMpdTag(tag);
|
||||
}
|
||||
|
||||
for(i=0;i<(data->synth).pcm.length;i++) {
|
||||
mpd_sint16 * sample;
|
||||
|
||||
@@ -643,10 +655,31 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
|
||||
|
||||
dc->totalTime = data.totalTime;
|
||||
|
||||
if(tag) {
|
||||
if(inStream->metaTitle) {
|
||||
if(inStream->metaTitle) {
|
||||
if(tag) freeMpdTag(tag);
|
||||
tag = newMpdTag();
|
||||
tag->title = strdup(inStream->metaTitle);
|
||||
/* free ths now, so we know we are done with it */
|
||||
free(inStream->metaTitle);
|
||||
inStream->metaTitle = NULL;
|
||||
if(inStream->metaName) {
|
||||
tag->name = strdup(inStream->metaName);
|
||||
}
|
||||
copyMpdTagToOutputBuffer(cb, tag);
|
||||
freeMpdTag(tag);
|
||||
}
|
||||
else if(tag) {
|
||||
if(inStream->metaName) {
|
||||
if(tag->name) free(tag->name);
|
||||
tag->name = strdup(inStream->metaTitle);
|
||||
tag->name = strdup(inStream->metaName);
|
||||
}
|
||||
copyMpdTagToOutputBuffer(cb, tag);
|
||||
freeMpdTag(tag);
|
||||
}
|
||||
else if(inStream->metaName) {
|
||||
tag = newMpdTag();
|
||||
if(inStream->metaName) {
|
||||
tag->name = strdup(inStream->metaName);
|
||||
}
|
||||
copyMpdTagToOutputBuffer(cb, tag);
|
||||
freeMpdTag(tag);
|
||||
|
||||
@@ -291,7 +291,7 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream)
|
||||
dc->state = DECODE_STATE_DECODE;
|
||||
}
|
||||
comments = ov_comment(&vf, -1)->user_comments;
|
||||
putOggCommentsIntoOutputBuffer(cb, inStream->metaTitle,
|
||||
putOggCommentsIntoOutputBuffer(cb, inStream->metaName,
|
||||
comments);
|
||||
replayGainScale = ogg_getReplayGainScale(comments);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user