mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
25 lines
475 B
C
25 lines
475 B
C
|
#include <stdio.h>
|
||
|
#include <fcntl.h>
|
||
|
|
||
|
int main(int argc,char *argv[]) {
|
||
|
int fd;
|
||
|
int offset = 0;
|
||
|
int got;
|
||
|
unsigned short buf[2048];
|
||
|
int i;
|
||
|
int prev = 0;
|
||
|
|
||
|
if (argc >= 2) fd = open(argv[1],O_RDONLY);
|
||
|
else fd = 0;
|
||
|
|
||
|
while (got = read(fd,buf,sizeof(buf))) {
|
||
|
for (i=0;i<(got/2);i++) {
|
||
|
if (buf[i] == 0x770b) {
|
||
|
printf("have sync at %d (+%d)\n",offset+(i*2),(offset+(i*2))-prev);
|
||
|
prev = offset+(i*2);
|
||
|
}
|
||
|
}
|
||
|
offset += got;
|
||
|
}
|
||
|
}
|