Commit bc5c918e authored by Diego Biurrun's avatar Diego Biurrun

Remove offset_t typedef and use int64_t directly instead.

The name offset_t is easily confused with the standard off_t type and
*_t is POSIX reserved namespace if any POSIX header is included.

Originally committed as revision 15533 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 0c45cd07
......@@ -172,9 +172,9 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
#ifdef CONFIG_AIFF_MUXER
typedef struct {
offset_t form;
offset_t frames;
offset_t ssnd;
int64_t form;
int64_t frames;
int64_t ssnd;
} AIFFOutputContext;
static int aiff_write_header(AVFormatContext *s)
......@@ -265,7 +265,7 @@ static int aiff_write_trailer(AVFormatContext *s)
AVCodecContext *enc = s->streams[0]->codec;
/* Chunks sizes must be even */
offset_t file_size, end_size;
int64_t file_size, end_size;
end_size = file_size = url_ftell(pb);
if (file_size & 1) {
put_byte(pb, 0);
......@@ -312,7 +312,7 @@ static int aiff_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
int size, filesize;
offset_t offset = 0;
int64_t offset = 0;
uint32_t tag;
unsigned version = AIFF_C_VERSION1;
ByteIOContext *pb = s->pb;
......
......@@ -88,7 +88,7 @@ static int au_write_packet(AVFormatContext *s, AVPacket *pkt)
static int au_write_trailer(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
offset_t file_size;
int64_t file_size;
if (!url_is_streamed(s->pb)) {
......
......@@ -1065,9 +1065,9 @@ int64_t av_gettime(void);
/* ffm-specific for ffserver */
#define FFM_PACKET_SIZE 4096
offset_t ffm_read_write_index(int fd);
void ffm_write_write_index(int fd, offset_t pos);
void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size);
int64_t ffm_read_write_index(int fd);
void ffm_write_write_index(int fd, int64_t pos);
void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
/**
* Attempts to find a specific tag in a URL.
......
......@@ -51,7 +51,7 @@ typedef struct {
int64_t riff_end;
int64_t movi_end;
int64_t fsize;
offset_t movi_list;
int64_t movi_list;
int index_loaded;
int is_odml;
int non_interleaved;
......@@ -217,7 +217,7 @@ static void clean_index(AVFormatContext *s){
static int avi_read_tag(ByteIOContext *pb, char *buf, int maxlen, unsigned int size)
{
offset_t i = url_ftell(pb);
int64_t i = url_ftell(pb);
size += (size & 1);
get_strz(pb, buf, maxlen);
url_fseek(pb, i+size, SEEK_SET);
......@@ -619,7 +619,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIContext *avi = s->priv_data;
ByteIOContext *pb = s->pb;
int n, d[8], size;
offset_t i, sync;
int64_t i, sync;
void* dstr;
if (ENABLE_DV_DEMUXER && avi->dv_demux) {
......@@ -937,7 +937,7 @@ static int avi_load_index(AVFormatContext *s)
AVIContext *avi = s->priv_data;
ByteIOContext *pb = s->pb;
uint32_t tag, size;
offset_t pos= url_ftell(pb);
int64_t pos= url_ftell(pb);
url_fseek(pb, avi->movi_end, SEEK_SET);
#ifdef DEBUG_SEEK
......
......@@ -35,15 +35,15 @@ typedef struct AVIIentry {
#define AVI_INDEX_CLUSTER_SIZE 16384
typedef struct AVIIndex {
offset_t indx_start;
int64_t indx_start;
int entry;
int ents_allocated;
AVIIentry** cluster;
} AVIIndex;
typedef struct {
offset_t riff_start, movi_list, odml_list;
offset_t frames_hdr_all, frames_hdr_strm[MAX_STREAMS];
int64_t riff_start, movi_list, odml_list;
int64_t frames_hdr_all, frames_hdr_strm[MAX_STREAMS];
int audio_strm_length[MAX_STREAMS];
int riff_id;
int packet_count[MAX_STREAMS];
......@@ -58,10 +58,10 @@ static inline AVIIentry* avi_get_ientry(AVIIndex* idx, int ent_id)
return &idx->cluster[cl][id];
}
static offset_t avi_start_new_riff(AVIContext *avi, ByteIOContext *pb,
const char* riff_tag, const char* list_tag)
static int64_t avi_start_new_riff(AVIContext *avi, ByteIOContext *pb,
const char* riff_tag, const char* list_tag)
{
offset_t loff;
int64_t loff;
int i;
avi->riff_id++;
......@@ -108,7 +108,7 @@ static int avi_write_counters(AVFormatContext* s, int riff_id)
ByteIOContext *pb = s->pb;
AVIContext *avi = s->priv_data;
int n, au_byterate, au_ssize, au_scale, nb_frames = 0;
offset_t file_size;
int64_t file_size;
AVCodecContext* stream;
file_size = url_ftell(pb);
......@@ -141,7 +141,7 @@ static int avi_write_header(AVFormatContext *s)
ByteIOContext *pb = s->pb;
int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
AVCodecContext *stream, *video_enc;
offset_t list1, list2, strh, strf;
int64_t list1, list2, strh, strf;
/* header list */
avi->riff_id = 0;
......@@ -375,7 +375,7 @@ static int avi_write_ix(AVFormatContext *s)
return -1;
for (i=0;i<s->nb_streams;i++) {
offset_t ix, pos;
int64_t ix, pos;
avi_stream2fourcc(&tag[0], i, s->streams[i]->codec->codec_type);
ix_tag[3] = '0' + i;
......@@ -422,7 +422,7 @@ static int avi_write_idx1(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
AVIContext *avi = s->priv_data;
offset_t idx_chunk;
int64_t idx_chunk;
int i;
char tag[5];
......@@ -543,7 +543,7 @@ static int avi_write_trailer(AVFormatContext *s)
ByteIOContext *pb = s->pb;
int res = 0;
int i, j, n, nb_frames;
offset_t file_size;
int64_t file_size;
if (!url_is_streamed(pb)){
if (avi->riff_id == 1) {
......
......@@ -153,9 +153,9 @@ int url_write(URLContext *h, unsigned char *buf, int size)
return ret;
}
offset_t url_seek(URLContext *h, offset_t pos, int whence)
int64_t url_seek(URLContext *h, int64_t pos, int whence)
{
offset_t ret;
int64_t ret;
if (!h->prot->url_seek)
return AVERROR(EPIPE);
......@@ -183,9 +183,9 @@ int url_exist(const char *filename)
return 1;
}
offset_t url_filesize(URLContext *h)
int64_t url_filesize(URLContext *h)
{
offset_t pos, size;
int64_t pos, size;
size= url_seek(h, 0, AVSEEK_SIZE);
if(size<0){
......@@ -228,7 +228,7 @@ int av_url_read_pause(URLContext *h, int pause)
return h->prot->url_read_pause(h, pause);
}
offset_t av_url_read_seek(URLContext *h,
int64_t av_url_read_seek(URLContext *h,
int stream_index, int64_t timestamp, int flags)
{
if (!h->prot->url_read_seek)
......
......@@ -23,10 +23,6 @@
#include <stdint.h>
/* output byte stream handling */
typedef int64_t offset_t;
/* unbuffered I/O */
/**
......@@ -67,10 +63,10 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
int url_open(URLContext **h, const char *filename, int flags);
int url_read(URLContext *h, unsigned char *buf, int size);
int url_write(URLContext *h, unsigned char *buf, int size);
offset_t url_seek(URLContext *h, offset_t pos, int whence);
int64_t url_seek(URLContext *h, int64_t pos, int whence);
int url_close(URLContext *h);
int url_exist(const char *filename);
offset_t url_filesize(URLContext *h);
int64_t url_filesize(URLContext *h);
/**
* Return the maximum packet size associated to packetized file
......@@ -118,7 +114,7 @@ int av_url_read_pause(URLContext *h, int pause);
* @return >= 0 on success
* @see AVInputFormat::read_seek
*/
offset_t av_url_read_seek(URLContext *h,
int64_t av_url_read_seek(URLContext *h,
int stream_index, int64_t timestamp, int flags);
/**
......@@ -133,11 +129,11 @@ typedef struct URLProtocol {
int (*url_open)(URLContext *h, const char *filename, int flags);
int (*url_read)(URLContext *h, unsigned char *buf, int size);
int (*url_write)(URLContext *h, unsigned char *buf, int size);
offset_t (*url_seek)(URLContext *h, offset_t pos, int whence);
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
int (*url_close)(URLContext *h);
struct URLProtocol *next;
int (*url_read_pause)(URLContext *h, int pause);
offset_t (*url_read_seek)(URLContext *h,
int64_t (*url_read_seek)(URLContext *h,
int stream_index, int64_t timestamp, int flags);
} URLProtocol;
......@@ -162,8 +158,8 @@ typedef struct {
void *opaque;
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
offset_t (*seek)(void *opaque, offset_t offset, int whence);
offset_t pos; /**< position in the file of the current buffer */
int64_t (*seek)(void *opaque, int64_t offset, int whence);
int64_t pos; /**< position in the file of the current buffer */
int must_flush; /**< true if the next seek should flush */
int eof_reached; /**< true if eof reached */
int write_flag; /**< true if open for writing */
......@@ -174,7 +170,7 @@ typedef struct {
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
int error; ///< contains the error code or 0 if no error happened
int (*read_pause)(void *opaque, int pause);
offset_t (*read_seek)(void *opaque,
int64_t (*read_seek)(void *opaque,
int stream_index, int64_t timestamp, int flags);
} ByteIOContext;
......@@ -185,7 +181,7 @@ int init_put_byte(ByteIOContext *s,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
offset_t (*seek)(void *opaque, offset_t offset, int whence));
int64_t (*seek)(void *opaque, int64_t offset, int whence));
ByteIOContext *av_alloc_put_byte(
unsigned char *buffer,
int buffer_size,
......@@ -193,7 +189,7 @@ ByteIOContext *av_alloc_put_byte(
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
offset_t (*seek)(void *opaque, offset_t offset, int whence));
int64_t (*seek)(void *opaque, int64_t offset, int whence));
void put_byte(ByteIOContext *s, int b);
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
......@@ -213,25 +209,25 @@ void put_strz(ByteIOContext *s, const char *buf);
* fseek() equivalent for ByteIOContext.
* @return new position or AVERROR.
*/
offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence);
int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
/**
* Skip given number of bytes forward.
* @param offset number of bytes
*/
void url_fskip(ByteIOContext *s, offset_t offset);
void url_fskip(ByteIOContext *s, int64_t offset);
/**
* ftell() equivalent for ByteIOContext.
* @return position or AVERROR.
*/
offset_t url_ftell(ByteIOContext *s);
int64_t url_ftell(ByteIOContext *s);
/**
* Gets the filesize.
* @return filesize or AVERROR
*/
offset_t url_fsize(ByteIOContext *s);
int64_t url_fsize(ByteIOContext *s);
/**
* feof() equivalent for ByteIOContext.
......@@ -242,7 +238,7 @@ int url_feof(ByteIOContext *s);
int url_ferror(ByteIOContext *s);
int av_url_read_fpause(ByteIOContext *h, int pause);
offset_t av_url_read_fseek(ByteIOContext *h,
int64_t av_url_read_fseek(ByteIOContext *h,
int stream_index, int64_t timestamp, int flags);
#define URL_EOF (-1)
......
......@@ -35,7 +35,7 @@ int init_put_byte(ByteIOContext *s,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
offset_t (*seek)(void *opaque, offset_t offset, int whence))
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{
s->buffer = buffer;
s->buffer_size = buffer_size;
......@@ -68,7 +68,7 @@ ByteIOContext *av_alloc_put_byte(
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
offset_t (*seek)(void *opaque, offset_t offset, int whence)) {
int64_t (*seek)(void *opaque, int64_t offset, int whence)) {
ByteIOContext *s = av_mallocz(sizeof(ByteIOContext));
init_put_byte(s, buffer, buffer_size, write_flag, opaque,
read_packet, write_packet, seek);
......@@ -125,10 +125,10 @@ void put_flush_packet(ByteIOContext *s)
s->must_flush = 0;
}
offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
{
offset_t offset1;
offset_t pos;
int64_t offset1;
int64_t pos;
if(!s)
return AVERROR(EINVAL);
......@@ -157,7 +157,7 @@ offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
return AVERROR(EPIPE);
s->buf_ptr = s->buf_end + offset - s->pos;
} else {
offset_t res = AVERROR(EPIPE);
int64_t res = AVERROR(EPIPE);
#if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK)
if (s->write_flag) {
......@@ -176,19 +176,19 @@ offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
return offset;
}
void url_fskip(ByteIOContext *s, offset_t offset)
void url_fskip(ByteIOContext *s, int64_t offset)
{
url_fseek(s, offset, SEEK_CUR);
}
offset_t url_ftell(ByteIOContext *s)
int64_t url_ftell(ByteIOContext *s)
{
return url_fseek(s, 0, SEEK_CUR);
}
offset_t url_fsize(ByteIOContext *s)
int64_t url_fsize(ByteIOContext *s)
{
offset_t size;
int64_t size;
if(!s)
return AVERROR(EINVAL);
......@@ -546,7 +546,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h)
(*s)->max_packet_size = max_packet_size;
if(h->prot) {
(*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause;
(*s)->read_seek = (offset_t (*)(void *, int, int64_t, int))h->prot->url_read_seek;
(*s)->read_seek = (int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek;
}
return 0;
}
......@@ -660,11 +660,11 @@ int av_url_read_fpause(ByteIOContext *s, int pause)
return s->read_pause(s->opaque, pause);
}
offset_t av_url_read_fseek(ByteIOContext *s,
int64_t av_url_read_fseek(ByteIOContext *s,
int stream_index, int64_t timestamp, int flags)
{
URLContext *h = s->opaque;
offset_t ret;
int64_t ret;
if (!s->read_seek)
return AVERROR(ENOSYS);
ret = s->read_seek(h, stream_index, timestamp, flags);
......@@ -756,7 +756,7 @@ static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
return dyn_buf_write(opaque, buf, buf_size);
}
static offset_t dyn_buf_seek(void *opaque, offset_t offset, int whence)
static int64_t dyn_buf_seek(void *opaque, int64_t offset, int whence)
{
DynBuffer *d = opaque;
......
......@@ -42,7 +42,7 @@ enum {
typedef struct FFMContext {
/* only reading mode */
offset_t write_index, file_size;
int64_t write_index, file_size;
int read_state;
uint8_t header[FRAME_HEADER_SIZE+4];
......
......@@ -24,7 +24,7 @@
#ifdef CONFIG_FFSERVER
#include <unistd.h>
offset_t ffm_read_write_index(int fd)
int64_t ffm_read_write_index(int fd)
{
uint8_t buf[8];
......@@ -33,7 +33,7 @@ offset_t ffm_read_write_index(int fd)
return AV_RB64(buf);
}
void ffm_write_write_index(int fd, offset_t pos)
void ffm_write_write_index(int fd, int64_t pos)
{
uint8_t buf[8];
int i;
......@@ -44,7 +44,7 @@ void ffm_write_write_index(int fd, offset_t pos)
write(fd, buf, 8);
}
void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size)
void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size)
{
FFMContext *ffm = s->priv_data;
ffm->write_index = pos;
......@@ -55,7 +55,7 @@ void ffm_set_write_index(AVFormatContext *s, offset_t pos, offset_t file_size)
static int ffm_is_avail_data(AVFormatContext *s, int size)
{
FFMContext *ffm = s->priv_data;
offset_t pos, avail_size;
int64_t pos, avail_size;
int len;
len = ffm->packet_end - ffm->packet_ptr;
......@@ -141,11 +141,11 @@ static int ffm_read_data(AVFormatContext *s,
/* pos is between 0 and file_size - FFM_PACKET_SIZE. It is translated
by the write position inside this function */
static void ffm_seek1(AVFormatContext *s, offset_t pos1)
static void ffm_seek1(AVFormatContext *s, int64_t pos1)
{
FFMContext *ffm = s->priv_data;
ByteIOContext *pb = s->pb;
offset_t pos;
int64_t pos;
pos = pos1 + ffm->write_index;
if (pos >= ffm->file_size)
......@@ -156,7 +156,7 @@ static void ffm_seek1(AVFormatContext *s, offset_t pos1)
url_fseek(pb, pos, SEEK_SET);
}
static int64_t get_dts(AVFormatContext *s, offset_t pos)
static int64_t get_dts(AVFormatContext *s, int64_t pos)
{
ByteIOContext *pb = s->pb;
int64_t dts;
......@@ -175,10 +175,10 @@ static void adjust_write_index(AVFormatContext *s)
FFMContext *ffm = s->priv_data;
ByteIOContext *pb = s->pb;
int64_t pts;
//offset_t orig_write_index = ffm->write_index;
offset_t pos_min, pos_max;
//int64_t orig_write_index = ffm->write_index;
int64_t pos_min, pos_max;
int64_t pts_start;
offset_t ptr = url_ftell(pb);
int64_t ptr = url_ftell(pb);
pos_min = 0;
......@@ -199,7 +199,7 @@ static void adjust_write_index(AVFormatContext *s)
if (pts - 100000 <= pts_start) {
while (1) {
offset_t newpos;
int64_t newpos;
int64_t newpts;
newpos = ((pos_max + pos_min) / (2 * FFM_PACKET_SIZE)) * FFM_PACKET_SIZE;
......@@ -419,7 +419,7 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags)
{
FFMContext *ffm = s->priv_data;
offset_t pos_min, pos_max, pos;
int64_t pos_min, pos_max, pos;
int64_t pts_min, pts_max, pts;
double pos1;
......
......@@ -67,7 +67,7 @@ static int file_write(URLContext *h, unsigned char *buf, int size)
}
/* XXX: use llseek */
static offset_t file_seek(URLContext *h, offset_t pos, int whence)
static int64_t file_seek(URLContext *h, int64_t pos, int whence)
{
int fd = (size_t)h->priv_data;
return lseek(fd, pos, whence);
......
......@@ -48,8 +48,8 @@ static const AVCodecTag flv_audio_codec_ids[] = {
typedef struct FLVContext {
int reserved;
offset_t duration_offset;
offset_t filesize_offset;
int64_t duration_offset;
int64_t filesize_offset;
int64_t duration;
int delay; ///< first dts delay for AVC
} FLVContext;
......@@ -250,7 +250,7 @@ static int flv_write_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
offset_t pos;
int64_t pos;
put_byte(pb, enc->codec_type == CODEC_TYPE_VIDEO ?
FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
put_be24(pb, 0); // size patched later
......
......@@ -120,16 +120,16 @@ static int gxf_find_lines_index(GXFStreamContext *ctx)
return -1;
}
static void gxf_write_padding(ByteIOContext *pb, offset_t to_pad)
static void gxf_write_padding(ByteIOContext *pb, int64_t to_pad)
{
for (; to_pad > 0; to_pad--) {
put_byte(pb, 0);
}
}
static offset_t updatePacketSize(ByteIOContext *pb, offset_t pos)
static int64_t updatePacketSize(ByteIOContext *pb, int64_t pos)
{
offset_t curpos;
int64_t curpos;
int size;
size = url_ftell(pb) - pos;
......@@ -144,9 +144,9 @@ static offset_t updatePacketSize(ByteIOContext *pb, offset_t pos)
return curpos - pos;
}
static offset_t updateSize(ByteIOContext *pb, offset_t pos)
static int64_t updateSize(ByteIOContext *pb, int64_t pos)
{
offset_t curpos;
int64_t curpos;
curpos = url_ftell(pb);
url_fseek(pb, pos, SEEK_SET);
......@@ -207,7 +207,7 @@ static int gxf_write_timecode_auxiliary(ByteIOContext *pb, GXFStreamContext *ctx
static int gxf_write_track_description(ByteIOContext *pb, GXFStreamContext *stream)
{
offset_t pos;
int64_t pos;
/* track description section */
put_byte(pb, stream->media_type + 0x80);
......@@ -261,7 +261,7 @@ static int gxf_write_track_description(ByteIOContext *pb, GXFStreamContext *stre
static int gxf_write_material_data_section(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos;
int64_t pos;
const char *filename = strrchr(ctx->fc->filename, '/');
pos = url_ftell(pb);
......@@ -307,7 +307,7 @@ static int gxf_write_material_data_section(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_track_description_section(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos;
int64_t pos;
int i;
pos = url_ftell(pb);
......@@ -319,7 +319,7 @@ static int gxf_write_track_description_section(ByteIOContext *pb, GXFContext *ct
static int gxf_write_map_packet(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
gxf_write_packet_header(pb, PKT_MAP);
......@@ -336,7 +336,7 @@ static int gxf_write_map_packet(ByteIOContext *pb, GXFContext *ctx)
#if 0
static int gxf_write_flt_packet(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
int i;
gxf_write_packet_header(pb, PKT_FLT);
......@@ -390,7 +390,7 @@ static int gxf_write_umf_payload(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_umf_track_description(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
int tracks[255]={0};
int i;
......@@ -486,7 +486,7 @@ static int gxf_write_umf_media_mjpeg(ByteIOContext *pb, GXFStreamContext *track)
static int gxf_write_umf_media_description(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos;
int64_t pos;
int i;
pos = url_ftell(pb);
......@@ -494,7 +494,7 @@ static int gxf_write_umf_media_description(ByteIOContext *pb, GXFContext *ctx)
for (i = 0; i < ctx->fc->nb_streams; ++i) {
GXFStreamContext *sc = &ctx->streams[i];
char buffer[88];
offset_t startpos, curpos;
int64_t startpos, curpos;
int path_size = strlen(ES_NAME_PATTERN);
memset(buffer, 0, 88);
......@@ -538,7 +538,7 @@ static int gxf_write_umf_media_description(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_umf_user_data(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
ctx->umf_user_data_offset = pos - ctx->umf_start_offset;
put_le32(pb, 20);
put_le32(pb, 0);
......@@ -554,7 +554,7 @@ static int gxf_write_umf_user_data(ByteIOContext *pb, GXFContext *ctx)
static int gxf_write_umf_packet(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
gxf_write_packet_header(pb, PKT_UMF);
......@@ -663,7 +663,7 @@ static int gxf_write_header(AVFormatContext *s)
static int gxf_write_eos_packet(ByteIOContext *pb, GXFContext *ctx)
{
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
gxf_write_packet_header(pb, PKT_EOS);
return updatePacketSize(pb, pos);
......@@ -673,7 +673,7 @@ static int gxf_write_trailer(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
GXFContext *gxf = s->priv_data;
offset_t end;
int64_t end;
int i;
for (i = 0; i < s->nb_streams; ++i) {
......@@ -745,7 +745,7 @@ static int gxf_write_media_preamble(ByteIOContext *pb, GXFContext *ctx, AVPacket
static int gxf_write_media_packet(ByteIOContext *pb, GXFContext *ctx, AVPacket *pkt)
{
GXFStreamContext *sc = &ctx->streams[pkt->stream_index];
offset_t pos = url_ftell(pb);
int64_t pos = url_ftell(pb);
int padding = 0;
gxf_write_packet_header(pb, PKT_MEDIA);
......
......@@ -41,7 +41,7 @@ typedef struct {
unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end;
int line_count;
int http_code;
offset_t off, filesize;
int64_t off, filesize;
char location[URL_SIZE];
} HTTPContext;
......@@ -213,7 +213,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
char line[1024], *q;
char *auth_b64;
int auth_b64_len = strlen(auth)* 4 / 3 + 12;
offset_t off = s->off;
int64_t off = s->off;
/* send http header */
......@@ -316,11 +316,11 @@ static int http_close(URLContext *h)
return 0;
}
static offset_t http_seek(URLContext *h, offset_t off, int whence)
static int64_t http_seek(URLContext *h, int64_t off, int whence)
{
HTTPContext *s = h->priv_data;
URLContext *old_hd = s->hd;
offset_t old_off = s->off;
int64_t old_off = s->off;
if (whence == AVSEEK_SIZE)
return s->filesize;
......
......@@ -181,7 +181,7 @@ static int roq_read_packet(AVFormatContext *s,
unsigned int codebook_size;
unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];
int packet_read = 0;
offset_t codebook_offset;
int64_t codebook_offset;
while (!packet_read) {
......
......@@ -107,14 +107,14 @@ typedef struct IPMVEContext {