mirror of
https://github.com/thinkonmay/sunshine-sdk.git
synced 2026-08-06 20:54:52 +00:00
add checksum
This commit is contained in:
parent
30cc9c1892
commit
8d4003046d
@ -293,9 +293,12 @@ main(int argc, char *argv[]) {
|
||||
updated = 0;
|
||||
|
||||
findex++;
|
||||
uint16_t sum = 0;
|
||||
for (int i=1;i<size+1;i++) sum += (unsigned char)*(ptr+i-1)*i;
|
||||
queue->incoming[updated].size = 0;
|
||||
copy_to_packet(&queue->incoming[updated],&findex,sizeof(uint32_t));
|
||||
copy_to_packet(&queue->incoming[updated],&utimestamp,sizeof(uint64_t));
|
||||
copy_to_packet(&queue->incoming[updated],&sum,sizeof(uint16_t));
|
||||
copy_to_packet(&queue->incoming[updated],ptr,size);
|
||||
queue->inindex = updated;
|
||||
} while (video_packets->peek());
|
||||
@ -311,9 +314,12 @@ main(int argc, char *argv[]) {
|
||||
updated = 0;
|
||||
|
||||
findex++;
|
||||
uint16_t sum = 0;
|
||||
for (int i=1;i<size+1;i++) sum += (unsigned char)*(ptr+i-1)*i;
|
||||
queue->incoming[updated].size = 0;
|
||||
copy_to_packet(&queue->incoming[updated],&findex,sizeof(uint32_t));
|
||||
copy_to_packet(&queue->incoming[updated],&utimestamp,sizeof(uint64_t));
|
||||
copy_to_packet(&queue->incoming[updated],&sum,sizeof(uint16_t));
|
||||
copy_to_packet(&queue->incoming[updated],ptr,size);
|
||||
queue->inindex = updated;
|
||||
} while (audio_packets->peek());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user