aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-06 22:13:23 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-06 22:13:23 +0000
commit62f32ccb010070501ed2d518d31cb788e37f7b3d (patch)
tree213f3085001e6c7c878e657bac0f2ab098b96770 /src/decode.c
parent33f21b9374d3f57210e5e58881bf67662eaaec3f (diff)
downloadmpd-62f32ccb010070501ed2d518d31cb788e37f7b3d.tar.gz
mpd-62f32ccb010070501ed2d518d31cb788e37f7b3d.tar.xz
mpd-62f32ccb010070501ed2d518d31cb788e37f7b3d.zip
harden metadatabuffer
git-svn-id: https://svn.musicpd.org/mpd/trunk@1362 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index 8053f44fa..ea41aef31 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -406,7 +406,8 @@ void handleMetadata(OutputBuffer * cb, PlayerControl * pc) {
int meta = cb->metaChunk[cb->begin];
if( meta != previous ) {
if( meta >= 0 && pc->metadataState ==
- PLAYER_METADATA_STATE_WRITE)
+ PLAYER_METADATA_STATE_WRITE &&
+ cb->metaChunkSet[meta])
{
printf("METADATA!, copying it.\n");
memcpy(&(pc->metadataChunk),
@@ -414,6 +415,7 @@ void handleMetadata(OutputBuffer * cb, PlayerControl * pc) {
sizeof(MetadataChunk));
pc->metadataState =
PLAYER_METADATA_STATE_READ;
+ cb->metaChunkSet[meta] = 0;
previous = meta;
}
}
@@ -621,6 +623,7 @@ void decode() {
dc->seek = 0;
dc->stop = 0;
dc->start = 1;
+ clearAllMetaChunkSets(cb);
if(decode_pid==NULL || *decode_pid<=0) {
if(decoderInit(pc,cb,dc)<0) return;