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.
This commit is contained in:
Arwed v. Merkatz 2004-08-25 12:27:59 +00:00
parent 99aa2764dd
commit 4a4ec26aa3
3 changed files with 31 additions and 0 deletions

View file

@ -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>

View file

@ -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),

View file

@ -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,