summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArwed v. Merkatz <v.merkatz@gmx.net>2004-08-25 12:27:59 +0000
committerArwed v. Merkatz <v.merkatz@gmx.net>2004-08-25 12:27:59 +0000
commit4a4ec26aa3b041078f01848dac56ef1a528d33a1 (patch)
treed176a9910b767a0a70c71633b8a65cfe01f891d9
parent99aa2764dd986de8e41cec5034b8bfb4873418ec (diff)
Send vorbis headers at the beginning of a stream, fixes bug #141554.
Original commit message from CVS: Send vorbis headers at the beginning of a stream, fixes bug #141554.
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog5
-rw-r--r--gst/matroska/matroska-demux.c25
3 files changed, 31 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index ca46e98af..c493808a2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -18,3 +18,4 @@ Benjamin Otte <in7y118@public.uni-hamburg.de>
Ronald Bultje <rbultje@ronald.bitfreak.net>
Julien MOUTTE <julien@moutte.net>
Jan Schmidt <thaytan@mad.scientist.com>
+Arwed v. Merkatz <v.merkatz@gmx.net>
diff --git a/ChangeLog b/ChangeLog
index 35f72a0c6..8e8700f4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-25 Arwed v. Merkatz <v.merkatz@gmx.net>
+
+ * gst/matroska/matroska-demux.c: (gst_matroska_demux_parse_blockgroup),
+ send vorbis headers at the beginning of a stream, fixes bug #141554.
+
2004-08-24 Sebastien Cote <sc5@hermes.usherb.ca>
* gst-libs/gst/riff/riff-read.c: (gst_riff_peek_head),
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 4dc2fdf51..e4d637816 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -1896,6 +1896,31 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux * demux,
break;
}
+ if ((cluster_time + time == 0) &&
+ (!strcmp (demux->src[stream]->codec_id,
+ GST_MATROSKA_CODEC_ID_AUDIO_VORBIS))) {
+ /* start of the stream and vorbis audio, need to send the codec_priv
+ * data as first three packets */
+ guchar *p;
+ guint32 offset, length;
+ gint i;
+ GstBuffer *priv;
+
+ p = (unsigned char *) demux->src[stream]->codec_priv;
+ offset = 3;
+ for (i = 0; i < 2; i++) {
+ length = p[i + 1];
+ priv = gst_buffer_new_and_alloc (length);
+ memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
+ gst_pad_push (demux->src[stream]->pad, GST_DATA (priv));
+ offset += length;
+ }
+ length = demux->src[stream]->codec_priv_size - offset;
+ priv = gst_buffer_new_and_alloc (length);
+ memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
+ gst_pad_push (demux->src[stream]->pad, GST_DATA (priv));
+ }
+
if (res) {
for (n = 0; n < laces; n++) {
GstBuffer *sub = gst_buffer_create_sub (buf,