79 int start_partition, end_packet;
80 int extended_bits, part_id;
81 int pictureid_present = 0, tl0picidx_present = 0, tid_present = 0,
83 int pictureid = -1, pictureid_mask = 0;
84 int returned_old_frame = 0;
85 uint32_t old_timestamp = 0;
103 extended_bits = buf[0] & 0x80;
104 start_partition = buf[0] & 0x10;
105 part_id = buf[0] & 0x0f;
112 pictureid_present = buf[0] & 0x80;
113 tl0picidx_present = buf[0] & 0x40;
114 tid_present = buf[0] & 0x20;
115 keyidx_present = buf[0] & 0x10;
119 if (pictureid_present) {
125 pictureid =
AV_RB16(buf) & 0x7fff;
126 pictureid_mask = 0x7fff;
130 pictureid = buf[0] & 0x7f;
131 pictureid_mask = 0x7f;
136 if (tl0picidx_present) {
141 if (tid_present || keyidx_present) {
149 if (start_partition && part_id == 0 && len >= 3) {
151 int non_key = buf[0] & 0x01;
165 if (pictureid >= 0) {
168 "Missed a picture, sequence broken\n");
170 if (vp8->
data && !can_continue)
172 "Missed a picture, sequence broken\n");
175 uint16_t expected_seq = vp8->
prev_seq + 1;
176 int16_t
diff = seq - expected_seq;
185 if ((diff == 0 || diff == 1) && can_continue) {
189 "Missed too much, sequence broken\n");
194 "Missed unknown data, sequence broken\n");
204 returned_old_frame = 1;
220 uint16_t expected_seq = vp8->
prev_seq + 1;
228 "Received no start marker; dropping frame\n");
231 if (seq != expected_seq) {
234 "Missed part of a keyframe, sequence broken\n");
240 "Missed part of the first partition, sequence broken\n");
252 if (returned_old_frame) {
253 *timestamp = old_timestamp;
254 return end_packet ? 1 : 0;