aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-06 16:42:14 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-06 16:42:14 +0000
commit4e53282469de4fea4b8daaec67298bd3394f34bd (patch)
treeba8465c48ea1c75983992ba4b265efd1666d9843 /src/inputPlugins
parent926258605a56c015d1421ca5aaf818a8de343afc (diff)
downloadmpd-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 '')
-rw-r--r--src/inputPlugins/mp3_plugin.c6
-rw-r--r--src/inputPlugins/ogg_plugin.c23
2 files changed, 21 insertions, 8 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index a73276c74..f2ad57500 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -644,7 +644,11 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
dc->totalTime = data.totalTime;
if(tag) {
- copyMpdTagToDecoderControlMetadata(dc, tag);
+ if(inStream->metaTitle) {
+ if(tag->name) free(tag->name);
+ tag->name = strdup(inStream->metaTitle);
+ }
+ copyMpdTagToOutputBuffer(cb, tag);
freeMpdTag(tag);
}
diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c
index 9a27ad712..a79c0d876 100644
--- a/src/inputPlugins/ogg_plugin.c
+++ b/src/inputPlugins/ogg_plugin.c
@@ -200,21 +200,26 @@ MpdTag * oggCommentsParse(char ** comments) {
return ret;
}
-void putOggCommentsIntoDecoderControlMetadata(DecoderControl * dc,
- char ** comments)
+void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName,
+ char ** comments)
{
MpdTag * tag;
tag = oggCommentsParse(comments);
if(!tag) return;
- copyMpdTagToDecoderControlMetadata(dc, tag);
-
/*if(tag->artist) printf("Artist: %s\n", tag->artist);
if(tag->album) printf("Album: %s\n", tag->album);
if(tag->track) printf("Track: %s\n", tag->track);
if(tag->title) printf("Title: %s\n", tag->title);*/
+ if(streamName) {
+ if(tag->name) free(tag->name);
+ tag->name = strdup(streamName);
+ }
+
+ copyMpdTagToOutputBuffer(cb, tag);
+
freeMpdTag(tag);
}
@@ -280,10 +285,14 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream)
vorbis_info *vi=ov_info(&vf,-1);
dc->audioFormat.channels = vi->channels;
dc->audioFormat.sampleRate = vi->rate;
- getOutputAudioFormat(&(dc->audioFormat),&(cb->audioFormat));
+ if(dc->state == DECODE_STATE_START) {
+ getOutputAudioFormat(&(dc->audioFormat),
+ &(cb->audioFormat));
+ dc->state = DECODE_STATE_DECODE;
+ }
comments = ov_comment(&vf, -1)->user_comments;
- putOggCommentsIntoDecoderControlMetadata(dc, comments);
- dc->state = DECODE_STATE_DECODE;
+ putOggCommentsIntoOutputBuffer(cb, inStream->metaTitle,
+ comments);
replayGainScale = ogg_getReplayGainScale(comments);
}