Created wrapper functions for fseek and ftell for Qt avi 64 bit file I/O.

This commit is contained in:
mjbudd77 2021-09-01 20:53:34 -04:00
parent fe87e1387f
commit 51ef32413b
2 changed files with 23 additions and 3 deletions

View File

@ -31,13 +31,31 @@
*/
/*
* Usefull IO functions.
* Useful IO functions.
*/
#include <stdio.h>
#include "gwavi.h"
long long gwavi_t::ftell(FILE *fp)
{
#ifdef WIN32
return ::_ftelli64(fp);
#else
return ::ftell(fp);
#endif
}
int gwavi_t::fseek(FILE *fp, long long offset, int whence)
{
#ifdef WIN32
return ::_fseeki64( fp, offset, whence );
#else
return ::fseek( fp, offset, whence );
#endif
}
int
gwavi_t::write_int(FILE *out, unsigned int n)
{

View File

@ -191,13 +191,15 @@ class gwavi_t
struct gwavi_stream_format_v_t stream_format_v;
struct gwavi_stream_header_t stream_header_a;
struct gwavi_stream_format_a_t stream_format_a;
long marker;
long long marker;
std::vector <gwavi_index_rec_t> offsets;
long movi_fpos;
long long movi_fpos;
int bits_per_pixel;
char fourcc[8];
// helper functions
long long ftell(FILE *fp);
int fseek(FILE *stream, long long offset, int whence);
int write_avi_header(FILE *fp, struct gwavi_header_t *avi_header);
int write_stream_header(FILE *fp,
struct gwavi_stream_header_t *stream_header);