I have to read tags from an FLV file and there are three chars that identify the data length. I’ve read them into char dataLength[3], but I don’t know what to do next. It’s binary, not ASCII, so it’s not as simple as using atoi() to convert char xxx[] = "123" into the integer 123. Here is my C struct for the tags:
typedef struct {
int previousLength;
char identify; // 8: AUDIO, 9:VIDEO 18: SCRIPT
char dataLength[3];
char time[3];
char timeExt;
char streamID[3]; // always 0;
char unused__;
} FLVTag;
I can read the tags from the file, but how do I convert dataLength into an int?
Big-endian according to http://osflash.org/flv.