Skip to content

Commit

Permalink
frontend: address compile warning + add missing LF (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
basicmaster authored May 1, 2020
1 parent 793d77a commit 3810269
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ static int faad_main(int argc, char *argv[])
char *adtsFileName = NULL;
float seekTo = 0;
unsigned char header[8];
int bread;
float length = 0;
FILE *hMP4File;
char *faad_id_string;
Expand Down Expand Up @@ -1300,16 +1301,21 @@ static int faad_main(int argc, char *argv[])
}
}

fread(header, 1, 8, hMP4File);
bread = fread(header, 1, 8, hMP4File);

if (! readFromStdin )
fclose(hMP4File);

if (bread != 8) {
faad_fprintf(stderr, "Error reading file.\n");
return 1;
}

if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
mp4file = 1;

if (!mp4file && seekTo != 0) {
faad_fprintf(stderr, "Warning: can only seek in MP4 files");
faad_fprintf(stderr, "Warning: can only seek in MP4 files\n");
}

if (mp4file)
Expand Down

0 comments on commit 3810269

Please sign in to comment.