Force IO to binary and seek to frames
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1360 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+3
-2
@@ -24,13 +24,13 @@ main(int argc, char *argv[]) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
in = fopen(argv[1], "r");
|
in = fopen(argv[1], "rb");
|
||||||
if (!in) {
|
if (!in) {
|
||||||
perror("Could not open input file");
|
perror("Could not open input file");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
out = fopen(argv[2], "w");
|
out = fopen(argv[2], "wb");
|
||||||
if (!out) {
|
if (!out) {
|
||||||
perror("Could not open output file");
|
perror("Could not open output file");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
@@ -95,6 +95,7 @@ convert_abx(FILE *in, FILE *out) {
|
|||||||
uncoded = malloc(sizeof (uint8_t *) * abx.num_frames);
|
uncoded = malloc(sizeof (uint8_t *) * abx.num_frames);
|
||||||
for (i = 0; i < abx.num_frames; i++) {
|
for (i = 0; i < abx.num_frames; i++) {
|
||||||
frames[i] = malloc(frame_info[i].fsize);
|
frames[i] = malloc(frame_info[i].fsize);
|
||||||
|
fseek(in, frame_info[i].addr, SEEK_SET);
|
||||||
read_data(frames[i], frame_info[i].fsize, in);
|
read_data(frames[i], frame_info[i].fsize, in);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
Reference in New Issue
Block a user