gst/wavparse/gstwavparse.c: Handle the acid chunk and send tempo as part of tags. Other fields are interesting too, b...

Original commit message from CVS:
* gst/wavparse/gstwavparse.c:
Handle the acid chunk and send tempo as part of tags. Other fields are
interesting too, but need more tag-definitions. Fixes #545433.
This commit is contained in:
Stefan Kost 2008-08-05 14:22:12 +00:00
parent 6d0e3ac396
commit 8e98d264cd
2 changed files with 40 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-08-05 Stefan Kost <ensonic@users.sf.net>
* gst/wavparse/gstwavparse.c:
Handle the acid chunk and send tempo as part of tags. Other fields are
interesting too, but need more tag-definitions. Fixes #545433.
2008-08-05 Stefan Kost <ensonic@users.sf.net>
* gst/wavparse/gstwavparse.c:

View file

@ -1316,6 +1316,40 @@ gst_wavparse_stream_headers (GstWavParse * wav)
}
break;
}
case GST_RIFF_TAG_acid:{
const gst_riff_acid *acid = NULL;
const guint data_size = sizeof (gst_riff_acid);
if (wav->streaming) {
if (gst_adapter_available (wav->adapter) < 8 + data_size) {
return GST_FLOW_OK;
}
gst_adapter_flush (wav->adapter, 8);
acid = (const gst_riff_acid *) gst_adapter_peek (wav->adapter,
data_size);
} else {
gst_buffer_unref (buf);
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset + 8,
data_size, &buf)) != GST_FLOW_OK)
goto header_read_error;
acid = (const gst_riff_acid *) GST_BUFFER_DATA (buf);
}
GST_INFO_OBJECT (wav, "Have acid chunk");
/* send data as tags */
if (!wav->tags)
wav->tags = gst_tag_list_new ();
gst_tag_list_add (wav->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_BEATS_PER_MINUTE, acid->tempo, NULL);
if (wav->streaming) {
gst_adapter_flush (wav->adapter, data_size);
} else {
gst_buffer_unref (buf);
wav->offset += 8 + data_size;
}
break;
}
default:
gst_waveparse_ignore_chunk (wav, buf, tag, size);
}