From 8e98d264cdb9e227793b79af769175d1ae31ec73 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 5 Aug 2008 14:22:12 +0000 Subject: 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. --- gst/wavparse/gstwavparse.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gst/wavparse') diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 822c8138..fde7dbc3 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -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); } -- cgit