theoraenc: 0-length packets are delta units
authorDavid Schleef <ds@schleef.org>
Tue, 30 Mar 2010 03:07:52 +0000 (20:07 -0700)
committerDavid Schleef <ds@schleef.org>
Tue, 30 Mar 2010 03:54:46 +0000 (20:54 -0700)
ext/theora/gsttheoraenc.c

index 9594562..0c231a4 100644 (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);