#include <string.h>
#ifdef __MINGW32__
+#undef fseeko
#define fseeko(x, y, z) fseeko64(x, y, z)
+#undef ftello
#define ftello(x) ftello64(x)
#elif defined(_WIN32)
+#undef fseeko
#define fseeko(x, y, z) _fseeki64(x, y, z)
+#undef ftello
#define ftello(x) _ftelli64(x)
#endif
#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
-#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
- (((uint8_t*)(x))[1] << 16) | \
- (((uint8_t*)(x))[2] << 8) | \
- ((uint8_t*)(x))[3])
+#define BE_32(x) (((uint32_t)(((uint8_t*)(x))[0]) << 24) | \
+ (((uint8_t*)(x))[1] << 16) | \
+ (((uint8_t*)(x))[2] << 8) | \
+ ((uint8_t*)(x))[3])
#define BE_64(x) (((uint64_t)(((uint8_t*)(x))[0]) << 56) | \
((uint64_t)(((uint8_t*)(x))[1]) << 48) | \
int bytes_to_copy;
if (argc != 3) {
- printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n");
+ printf("Usage: qt-faststart <infile.mov> <outfile.mov>\n"
+ "Note: alternatively you can use -movflags +faststart in avconv\n");
return 0;
}
if (fread(atom_bytes, ATOM_PREAMBLE_SIZE, 1, infile) != 1) {
break;
}
- atom_size = (uint32_t) BE_32(&atom_bytes[0]);
+ atom_size = BE_32(&atom_bytes[0]);
atom_type = BE_32(&atom_bytes[4]);
/* keep ftyp atom */