Lines Matching defs:packet
90 static struct stream packet;
600 unimpl("RDPSND packet type %x\n", opcode);
612 /* New packet */
613 if (packet.size == 0)
617 error("RDPSND: Split at packet header. Things will go south from here...\n");
627 packet.p = packet.data;
628 packet.end = packet.data + len;
629 packet.size = len;
633 len = MIN(s->end - s->p, packet.end - packet.p);
638 if ((packet.p - packet.data) < 12)
639 len = MIN(len, 12 - (packet.p - packet.data));
640 else if ((packet.p - packet.data) == 12)
649 in_uint8a(s, packet.p, len);
650 packet.p += len;
654 if (packet.p == packet.end)
656 packet.p = packet.data;
657 rdpsnd_process_packet(packet_opcode, &packet);
658 packet.size = 0;
733 packet.data = (uint8 *) xmalloc(65536);
734 packet.p = packet.end = packet.data;
735 packet.size = 0;
855 struct audio_packet *packet = &packet_queue[queue_hi];
860 error("No space to queue audio packet\n");
866 packet->s = *s;
867 packet->tick = tick;
868 packet->index = index;
870 gettimeofday(&packet->arrive_tv, NULL);
894 struct audio_packet *packet;
899 packet = &packet_queue[queue_pending];
900 xfree(packet->s.data);
911 struct audio_packet *packet;
915 packet = &packet_queue[queue_lo];
917 gettimeofday(&packet->completion_tv, NULL);
919 packet->completion_tv.tv_usec += completed_in_us;
920 packet->completion_tv.tv_sec += packet->completion_tv.tv_usec / 1000000;
921 packet->completion_tv.tv_usec %= 1000000;
946 struct audio_packet *packet;
952 packet = &packet_queue[queue_pending];
954 if (now.tv_sec < packet->completion_tv.tv_sec)
957 if ((now.tv_sec == packet->completion_tv.tv_sec) &&
958 (now.tv_usec < packet->completion_tv.tv_usec))
961 elapsed = (packet->completion_tv.tv_sec - packet->arrive_tv.tv_sec) * 1000000 +
962 (packet->completion_tv.tv_usec - packet->arrive_tv.tv_usec);
965 xfree(packet->s.data);
966 rdpsnd_send_completion((packet->tick + elapsed) % 65536, packet->index);
974 struct audio_packet *packet;
983 packet = &packet_queue[queue_pending];
985 remaining = (packet->completion_tv.tv_sec - now.tv_sec) * 1000000 +
986 (packet->completion_tv.tv_usec - now.tv_usec);