aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp3_plugin.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-07 05:00:56 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-07 05:00:56 +0000
commit283e34eaae554604ed1f2f848026840c0eed3dfd (patch)
tree1ca514a48ce28be1da09eee5eed95435b760b9ad /src/inputPlugins/mp3_plugin.c
parent74f1c8c0181ce00546455b5408a186cca02f16cb (diff)
downloadmpd-283e34eaae554604ed1f2f848026840c0eed3dfd.tar.gz
mpd-283e34eaae554604ed1f2f848026840c0eed3dfd.tar.xz
mpd-283e34eaae554604ed1f2f848026840c0eed3dfd.zip
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
Diffstat (limited to 'src/inputPlugins/mp3_plugin.c')
-rw-r--r--src/inputPlugins/mp3_plugin.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index f2ad57500..2921c9351 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -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);