32 int len,
h, max_packet_size;
35 int begin_of_slice, end_of_slice, frame_type, temporal_reference;
37 max_packet_size =
s->max_payload_size;
41 temporal_reference = 0;
44 int begin_of_sequence;
46 begin_of_sequence = 0;
47 len = max_packet_size - 4;
63 frame_type = (
r[1] & 0x38) >> 3;
64 temporal_reference = (
int)
r[0] << 2 |
r[1] >> 6;
67 begin_of_sequence = 1;
70 if (
r - buf1 - 4 <=
len) {
72 if (begin_of_slice == 0) {
80 if ((r1 - buf1 > 4) && (
r - r1 < max_packet_size)) {
93 h |= temporal_reference << 16;
94 h |= begin_of_sequence << 13;
95 h |= begin_of_slice << 12;
96 h |= end_of_slice << 11;
105 memcpy(q, buf1,
len);
109 s->timestamp =
s->cur_timestamp;
114 begin_of_slice = end_of_slice;