theoraenc: 0-length packets are delta units

This commit is contained in:
David Schleef 2010-03-29 20:07:52 -07:00
parent 93e408bdbb
commit 681721466d

View file

@ -610,7 +610,7 @@ 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] & 0x40) == 0) {
if (packet->bytes > 0 && (packet->packet[0] & 0x40) == 0) {
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
} else {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);