view barpainet.c @ 207:7865656658dc libavformat

stdin patch by (Charles Yates <charles dot yates at pandora dot be>) * removes use of read_key and getchar when input is received on stdin (this was corrupting the packet reading) * terminates av_encode when a termination signal is received (use of ctrl-c issued a term_exit and subsequent uses of q failed) * specific correction to yuv4mpeg pipe reading - the defined header was too short to allow for extended yuv4mpeg flags [as used by smil2yuv and y4mscaler and accepted by mjpeg tools]
author michaelni
date Fri, 29 Aug 2003 20:51:10 +0000
parents 05318cf2e886
children da1d5db0ce5c
line wrap: on
line source


#include <stdlib.h>
#include <strings.h>
#include "barpainet.h"

int inet_aton (const char * str, struct in_addr * add) {
	const char * pch = str;
	unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
	
	add1 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add2 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add3 = atoi(pch);
	pch = strpbrk(pch,".");
	if (pch == 0 || ++pch == 0) goto done;
	add4 = atoi(pch);

done:
	add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
	
	return 1;	
}