view barpainet.c @ 584:4e3bab6555ae libavformat

When playing ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/QPEG/VWbig6.avi with my decoder (should appear soon) it hadn't changed palette even there are palette change chunks in that AVI. Here is small patch to make it work (zero number of colors to change in that chunk actually means to change ALL colors). patch by (Kostya <cannonball>at<bw-team>dot<com>)
author michael
date Fri, 12 Nov 2004 01:32:35 +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;	
}