ext/theora/theoraenc.c: Fix bug where buffers were not marked as keyframes correctly.

Original commit message from CVS:
* ext/theora/theoraenc.c: (gst_border_mode_get_type),
(gst_theora_enc_class_init), (theora_enc_sink_link),
(theora_buffer_from_packet), (theora_enc_chain):
Fix bug where buffers were not marked as keyframes
correctly.
This commit is contained in:
Wim Taymans 2004-08-16 10:19:39 +00:00
parent 004cccd92d
commit d01cd571b2
2 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2004-08-16 Wim Taymans <wim@fluendo.com>
* ext/theora/theoraenc.c: (gst_border_mode_get_type),
(gst_theora_enc_class_init), (theora_enc_sink_link),
(theora_buffer_from_packet), (theora_enc_chain):
Fix bug where buffers were not marked as keyframes
correctly.
2004-08-15 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* ext/lame/gstlame.c: (gst_lame_vbrmode_get_type),

View file

@ -372,8 +372,12 @@ theora_buffer_from_packet (GstTheoraEnc * enc, ogg_packet * packet,
/* the second most significant bit of the first data byte is cleared
* for keyframes */
if ((packet->packet[0] & 40) == 0) {
if ((packet->packet[0] & 0x40) == 0) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_KEY_UNIT);
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_DELTA_UNIT);
} else {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_KEY_UNIT);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DELTA_UNIT);
}
enc->packetno++;
@ -463,17 +467,17 @@ theora_enc_chain (GstPad * pad, GstData * data)
in_time = GST_BUFFER_TIMESTAMP (buf);
/* no packets written yet, setup headers */
/* Theora streams begin with three headers; the initial header (with
most of the codec setup parameters) which is mandated by the Ogg
bitstream spec. The second header holds any comment fields. The
third header holds the bitstream codebook. We merely need to
make the headers, then pass them to libtheora one at a time;
libtheora handles the additional Ogg bitstream constraints */
if (enc->packetno == 0) {
GstCaps *caps;
GstBuffer *buf1, *buf2, *buf3;
/* Theora streams begin with three headers; the initial header (with
most of the codec setup parameters) which is mandated by the Ogg
bitstream spec. The second header holds any comment fields. The
third header holds the bitstream codebook. We merely need to
make the headers, then pass them to libtheora one at a time;
libtheora handles the additional Ogg bitstream constraints */
/* first packet will get its own page automatically */
theora_encode_header (&enc->state, &op);
buf1 = theora_buffer_from_packet (enc, &op, 0, 0);