Hoi,
ich schreibe in C gerade eine Funktion um mir die Header-Informationen von ein MOV-Container in ein Struct zu packen aber irgendwie steh ich gerade aufn schlauch.
Alles anzeigen
raus kommt:[Blockierte Grafik: http://img196.imageshack.us/img196/1097/bildschirmfoto20111201u.png]
wenn ich das mov in der hexView aufmache sehe ich das die ersten 4 Byte 00 00 00 20 sind die nächsten 4 Byte 66 74 79 70 also 'ftyp'... oder seh ich das falsch?
[Blockierte Grafik: http://img18.imageshack.us/img18/1707/bildschirmfoto20111201us.png]
ich schreibe in C gerade eine Funktion um mir die Header-Informationen von ein MOV-Container in ein Struct zu packen aber irgendwie steh ich gerade aufn schlauch.
Quellcode
- struct movHeader {
- u_int8_t unknown1[4];
- u_int8_t unknown2[4];
- u_int8_t unknown3[4];
- u_int8_t unknown4[4];
- };
- char MOVMagic[] = "ftyp";
- int loadMOV(const char * path) {
- FILE *movFile;
- int dsize;
- u_int8_t *mov;
- struct movHeader *movHdr;
- if (!(movFile = fopen(path, "rb"))) {
- printf("File cannot be opened.");
- return 0;
- }
- fseek(movFile, 0, SEEK_END);
- dsize = (int)ftell(movFile);
- mov = (u_int8_t*)malloc(dsize);
- rewind(movFile);
- fread(mov, dsize, 1, movFile);
- fclose(movFile);
- movHdr = (struct movHeader*)mov;
- printf("unknown1: '%s' \n", (char *)movHdr->unknown1);
- printf("unknown2: '%s' \n", (char *)movHdr->unknown2);
- printf("unknown3: '%s' \n", (char *)movHdr->unknown3);
- printf("unknown4: '%s' \n", (char *)movHdr->unknown4);
- return 1;
- }
raus kommt:[Blockierte Grafik: http://img196.imageshack.us/img196/1097/bildschirmfoto20111201u.png]
wenn ich das mov in der hexView aufmache sehe ich das die ersten 4 Byte 00 00 00 20 sind die nächsten 4 Byte 66 74 79 70 also 'ftyp'... oder seh ich das falsch?
[Blockierte Grafik: http://img18.imageshack.us/img18/1707/bildschirmfoto20111201us.png]
俺の世界にようこそ
