theoraenc: use th_packet_iskeyframe instead of peeking at bits
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 4 Nov 2011 10:58:15 +0000 (10:58 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Nov 2011 12:27:14 +0000 (12:27 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=663391

ext/theora/gsttheoraenc.c

index 385603a..4ee0185 100644 (file)
@@ -781,9 +781,8 @@ theora_buffer_from_packet (GstTheoraEnc * enc, ogg_packet * packet,
     enc->next_discont = FALSE;
   }
 
-  /* the second most significant bit of the first data byte is cleared
-   * for keyframes */
-  if (packet->bytes > 0 && (packet->packet[0] & 0x40) == 0) {
+  /* th_packet_iskeyframe returns positive for keyframes */
+  if (th_packet_iskeyframe (packet) > 0) {
     GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
   } else {
     GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);