bugfix: faster response after video stream restart.
This commit is contained in:
parent
7326835f39
commit
c7ad0b69ab
|
@ -35,6 +35,10 @@
|
||||||
<Linker>
|
<Linker>
|
||||||
<Add option="-pthread" />
|
<Add option="-pthread" />
|
||||||
</Linker>
|
</Linker>
|
||||||
|
<Unit filename="checkvideo.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="checkvideo.h" />
|
||||||
<Unit filename="client.config" />
|
<Unit filename="client.config" />
|
||||||
<Unit filename="extern.c">
|
<Unit filename="extern.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<inttypes.h>
|
<inttypes.h>
|
||||||
|
|
||||||
1395876570 source:/home/chch/HengLongUDPclient/main.c
|
1395876660 source:/home/chch/HengLongUDPclient/main.c
|
||||||
<pthread.h>
|
<pthread.h>
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<stdlib.h>
|
<stdlib.h>
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
1395699958 /home/chch/HengLongUDPclient/extern.h
|
1395699958 /home/chch/HengLongUDPclient/extern.h
|
||||||
<stdlib.h>
|
<stdlib.h>
|
||||||
|
|
||||||
1395871885 /home/chch/HengLongUDPclient/checkvideo.h
|
1395878228 /home/chch/HengLongUDPclient/checkvideo.h
|
||||||
<stdio.h>
|
<stdio.h>
|
||||||
<stdlib.h>
|
<stdlib.h>
|
||||||
<inttypes.h>
|
<inttypes.h>
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
<CodeBlocks_layout_file>
|
<CodeBlocks_layout_file>
|
||||||
<ActiveTarget name="Debug" />
|
<ActiveTarget name="Debug" />
|
||||||
<File name="client.config" open="1" top="1" tabpos="8">
|
<File name="checkvideo.c" open="1" top="1" tabpos="9">
|
||||||
<Cursor position="66" topLine="0" />
|
<Cursor position="551" topLine="8" />
|
||||||
|
</File>
|
||||||
|
<File name="checkvideo.h" open="1" top="0" tabpos="10">
|
||||||
|
<Cursor position="208" topLine="0" />
|
||||||
|
</File>
|
||||||
|
<File name="client.config" open="1" top="0" tabpos="8">
|
||||||
|
<Cursor position="122" topLine="0" />
|
||||||
</File>
|
</File>
|
||||||
<File name="extern.c" open="1" top="0" tabpos="6">
|
<File name="extern.c" open="1" top="0" tabpos="6">
|
||||||
<Cursor position="41" topLine="0" />
|
<Cursor position="41" topLine="0" />
|
||||||
|
@ -17,10 +23,10 @@
|
||||||
<Cursor position="564" topLine="0" />
|
<Cursor position="564" topLine="0" />
|
||||||
</File>
|
</File>
|
||||||
<File name="main.c" open="1" top="0" tabpos="1">
|
<File name="main.c" open="1" top="0" tabpos="1">
|
||||||
<Cursor position="9478" topLine="499" />
|
<Cursor position="12726" topLine="438" />
|
||||||
</File>
|
</File>
|
||||||
<File name="wansview.c" open="1" top="0" tabpos="4">
|
<File name="wansview.c" open="1" top="0" tabpos="4">
|
||||||
<Cursor position="941" topLine="3" />
|
<Cursor position="941" topLine="0" />
|
||||||
</File>
|
</File>
|
||||||
<File name="wansview.h" open="1" top="0" tabpos="5">
|
<File name="wansview.h" open="1" top="0" tabpos="5">
|
||||||
<Cursor position="534" topLine="0" />
|
<Cursor position="534" topLine="0" />
|
||||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include "checkvideo.h"
|
#include "checkvideo.h"
|
||||||
|
|
||||||
int connectionstate(char* remip, uint16_t remport)
|
int connectionstate(char* remip, uint16_t remport, uint32_t state)
|
||||||
{
|
{
|
||||||
FILE* tcpfile;
|
FILE* tcpfile;
|
||||||
char line[256];
|
char line[256];
|
||||||
|
@ -15,9 +15,9 @@ int connectionstate(char* remip, uint16_t remport)
|
||||||
tcpfile = fopen("/proc/net/tcp","r");
|
tcpfile = fopen("/proc/net/tcp","r");
|
||||||
while(fgets(line,256,tcpfile)){
|
while(fgets(line,256,tcpfile)){
|
||||||
sscanf(line, "%*u: %*x:%*x %x:%x %x", &remipi, &remporti, &statei);
|
sscanf(line, "%*u: %*x:%*x %x:%x %x", &remipi, &remporti, &statei);
|
||||||
if((inet_addr(remip)==remipi) & (remport==remporti)) {
|
if((inet_addr(remip)==remipi) & (remport==remporti) & (state==statei)) {
|
||||||
fclose(tcpfile);
|
fclose(tcpfile);
|
||||||
return statei;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(tcpfile);
|
fclose(tcpfile);
|
||||||
|
@ -27,6 +27,6 @@ int connectionstate(char* remip, uint16_t remport)
|
||||||
int checkvideo(char* remip, uint16_t remport)
|
int checkvideo(char* remip, uint16_t remport)
|
||||||
{
|
{
|
||||||
if(0==remip[0]) return 2;
|
if(0==remip[0]) return 2;
|
||||||
if(1==connectionstate(remip, remport)) return 1;
|
if(1==connectionstate(remip, remport, 1)) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
int connectionstate(char* remip, uint16_t remport);
|
int connectionstate(char* remip, uint16_t remport, uint32_t state);
|
||||||
int checkvideo(char* remip, uint16_t remport);
|
int checkvideo(char* remip, uint16_t remport);
|
||||||
|
|
||||||
#endif // CHECKVIDEO_H_INCLUDED
|
#endif // CHECKVIDEO_H_INCLUDED
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue