69 int start_partition, end_packet;
70 int extended_bits, part_id;
71 int pictureid_present = 0, tl0picidx_present = 0, tid_present = 0,
73 int pictureid = -1, pictureid_mask;
74 int returned_old_frame = 0;
75 uint32_t old_timestamp;
90 extended_bits = buf[0] & 0x80;
91 start_partition = buf[0] & 0x10;
92 part_id = buf[0] & 0x0f;
99 pictureid_present = buf[0] & 0x80;
100 tl0picidx_present = buf[0] & 0x40;
101 tid_present = buf[0] & 0x20;
102 keyidx_present = buf[0] & 0x10;
106 if (pictureid_present) {
112 pictureid =
AV_RB16(buf) & 0x7fff;
113 pictureid_mask = 0x7fff;
117 pictureid = buf[0] & 0x7f;
118 pictureid_mask = 0x7f;
123 if (tl0picidx_present) {
128 if (tid_present || keyidx_present) {
136 if (start_partition && part_id == 0 && len >= 3) {
138 int non_key = buf[0] & 0x01;
148 if (pictureid >= 0) {
151 "Missed a picture, sequence broken\n");
153 if (vp8->
data && !can_continue)
155 "Missed a picture, sequence broken\n");
158 uint16_t expected_seq = vp8->
prev_seq + 1;
159 int16_t
diff = seq - expected_seq;
168 if ((diff == 0 || diff == 1) && can_continue) {
172 "Missed too much, sequence broken\n");
177 "Missed unknown data, sequence broken\n");
186 returned_old_frame = 1;
202 uint16_t expected_seq = vp8->
prev_seq + 1;
211 "Received no start marker; dropping frame\n");
216 if (seq != expected_seq) {
219 "Missed part of a keyframe, sequence broken\n");
224 "Missed part of the first partition, sequence broken\n");
237 if (returned_old_frame) {
238 *timestamp = old_timestamp;