theoraenc: use th_packet_iskeyframe instead of peeking at bits

https://bugzilla.gnome.org/show_bug.cgi?id=663391
This commit is contained in:
Vincent Penquerc'h 2011-11-04 10:58:15 +00:00
parent ffbe58fd5a
commit c1aab3e0a7

View 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);