diff options
author | Diego Biurrun <diego@biurrun.de> | 2008-10-03 10:16:29 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2008-10-03 10:16:29 +0000 |
commit | bc5c918ea8757514de0ec0327066251a2f1ec23f (patch) | |
tree | 81bdb2bd95adf7002bc895eec401c7badf36816e /libavformat | |
parent | 0c45cd0720cdf2415a93ef63475690faf68364c2 (diff) | |
download | ffmpeg-bc5c918ea8757514de0ec0327066251a2f1ec23f.tar.gz |
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
Diffstat (limited to 'libavformat')
36 files changed, 204 insertions, 208 deletions
diff --git a/libavformat/aiff.c b/libavformat/aiff.c index 3a4bf9f9dd..8bd69c200e 100644 --- a/libavformat/aiff.c +++ b/libavformat/aiff.c @@ -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; diff --git a/libavformat/au.c b/libavformat/au.c index ffb26ed54e..7d151cf1d6 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -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)) { diff --git a/libavformat/avformat.h b/libavformat/avformat.h index e11e78813e..d8e0b0a356 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -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. diff --git a/libavformat/avidec.c b/libavformat/avidec.c index b4494f7fbd..c9c27e262d 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -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 diff --git a/libavformat/avienc.c b/libavformat/avienc.c index db59555e45..a672e8d85c 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -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) { diff --git a/libavformat/avio.c b/libavformat/avio.c index 1278827802..c2acb4664e 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -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) diff --git a/libavformat/avio.h b/libavformat/avio.h index ef53154ff0..687333ed4a 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -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) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 34029a5ee7..ac7bb8f7fd 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -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; diff --git a/libavformat/ffm.h b/libavformat/ffm.h index 0ed5c227f3..4a52c407ad 100644 --- a/libavformat/ffm.h +++ b/libavformat/ffm.h @@ -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]; diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index d70c54594c..345e62e6a3 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -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; diff --git a/libavformat/file.c b/libavformat/file.c index 9640ff654e..e50168d89e 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -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); diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 16c18d9c51..ac5840727f 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -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 diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 20d09473fb..72a35c35c3 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -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); diff --git a/libavformat/http.c b/libavformat/http.c index fc9cac442d..6b3004d75c 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -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; diff --git a/libavformat/idroq.c b/libavformat/idroq.c index b5dae21b04..acf2db6c1c 100644 --- a/libavformat/idroq.c +++ b/libavformat/idroq.c @@ -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) { diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index 839e099a5e..4a766b2cde 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -107,14 +107,14 @@ typedef struct IPMVEContext { int video_stream_index; int audio_stream_index; - offset_t audio_chunk_offset; + int64_t audio_chunk_offset; int audio_chunk_size; - offset_t video_chunk_offset; + int64_t video_chunk_offset; int video_chunk_size; - offset_t decode_map_chunk_offset; + int64_t decode_map_chunk_offset; int decode_map_chunk_size; - offset_t next_chunk_offset; + int64_t next_chunk_offset; AVPaletteControl palette_control; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 04aa67aaed..0345f575c3 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -200,7 +200,7 @@ typedef struct { EbmlList seekhead; /* byte position of the segment inside the stream */ - offset_t segment_start; + int64_t segment_start; /* the packet queue */ AVPacket **packets; @@ -495,7 +495,7 @@ const struct { static int ebml_level_end(MatroskaDemuxContext *matroska) { ByteIOContext *pb = matroska->ctx->pb; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); if (matroska->num_levels > 0) { MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1]; @@ -527,7 +527,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb, if (!(total = get_byte(pb))) { /* we might encounter EOS here */ if (!url_feof(pb)) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); @@ -541,7 +541,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb, len_mask >>= 1; } if (read > max_size) { - offset_t pos = url_ftell(pb) - 1; + int64_t pos = url_ftell(pb) - 1; av_log(matroska->ctx, AV_LOG_ERROR, "Invalid EBML number size tag 0x%02x at pos %"PRIu64" (0x%"PRIx64")\n", (uint8_t) total, pos, pos); @@ -1000,12 +1000,12 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) EbmlList *seekhead_list = &matroska->seekhead; MatroskaSeekhead *seekhead = seekhead_list->elem; uint32_t level_up = matroska->level_up; - offset_t before_pos = url_ftell(matroska->ctx->pb); + int64_t before_pos = url_ftell(matroska->ctx->pb); MatroskaLevel level; int i; for (i=0; i<seekhead_list->nb_elem; i++) { - offset_t offset = seekhead[i].pos + matroska->segment_start; + int64_t offset = seekhead[i].pos + matroska->segment_start; if (seekhead[i].pos <= before_pos || seekhead[i].id == MATROSKA_ID_SEEKHEAD @@ -1666,7 +1666,7 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska) EbmlList *blocks_list; MatroskaBlock *blocks; int i, res; - offset_t pos = url_ftell(matroska->ctx->pb); + int64_t pos = url_ftell(matroska->ctx->pb); matroska->prev_pkt = NULL; if (matroska->has_cluster_id){ /* For the first cluster we parse, its ID was already read as diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index ef3140ee8b..5deb8deeae 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -29,7 +29,7 @@ #include "libavcodec/mpeg4audio.h" typedef struct ebml_master { - offset_t pos; ///< absolute offset in the file where the master's elements start + int64_t pos; ///< absolute offset in the file where the master's elements start int sizebytes; ///< how many bytes were reserved for the size } ebml_master; @@ -39,8 +39,8 @@ typedef struct mkv_seekhead_entry { } mkv_seekhead_entry; typedef struct mkv_seekhead { - offset_t filepos; - offset_t segment_offset; ///< the file offset to the beginning of the segment + int64_t filepos; + int64_t segment_offset; ///< the file offset to the beginning of the segment int reserved_size; ///< -1 if appending to file int max_entries; mkv_seekhead_entry *entries; @@ -50,23 +50,23 @@ typedef struct mkv_seekhead { typedef struct { uint64_t pts; int tracknum; - offset_t cluster_pos; ///< file offset of the cluster containing the block + int64_t cluster_pos; ///< file offset of the cluster containing the block } mkv_cuepoint; typedef struct { - offset_t segment_offset; + int64_t segment_offset; mkv_cuepoint *entries; int num_entries; } mkv_cues; typedef struct MatroskaMuxContext { ebml_master segment; - offset_t segment_offset; - offset_t segment_uid; + int64_t segment_offset; + int64_t segment_uid; ebml_master cluster; - offset_t cluster_pos; ///< file offset of the current cluster + int64_t cluster_pos; ///< file offset of the current cluster uint64_t cluster_pts; - offset_t duration_offset; + int64_t duration_offset; uint64_t duration; mkv_seekhead *main_seekhead; mkv_seekhead *cluster_seekhead; @@ -188,7 +188,7 @@ static void put_ebml_string(ByteIOContext *pb, unsigned int elementid, const cha */ static void put_ebml_void(ByteIOContext *pb, uint64_t size) { - offset_t currentpos = url_ftell(pb); + int64_t currentpos = url_ftell(pb); assert(size >= 2); @@ -214,7 +214,7 @@ static ebml_master start_ebml_master(ByteIOContext *pb, unsigned int elementid, static void end_ebml_master(ByteIOContext *pb, ebml_master master) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); // leave the unknown size for masters when streaming if (url_is_streamed(pb)) @@ -244,7 +244,7 @@ static void put_xiph_size(ByteIOContext *pb, int size) * @param numelements The maximum number of elements that will be indexed * by this seek head, 0 if unlimited. */ -static mkv_seekhead * mkv_start_seekhead(ByteIOContext *pb, offset_t segment_offset, int numelements) +static mkv_seekhead * mkv_start_seekhead(ByteIOContext *pb, int64_t segment_offset, int numelements) { mkv_seekhead *new_seekhead = av_mallocz(sizeof(mkv_seekhead)); if (new_seekhead == NULL) @@ -291,10 +291,10 @@ static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid * * @return The file offset where the seekhead was written. */ -static offset_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead) +static int64_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead) { ebml_master metaseek, seekentry; - offset_t currentpos; + int64_t currentpos; int i; currentpos = url_ftell(pb); @@ -330,7 +330,7 @@ static offset_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead) return currentpos; } -static mkv_cues * mkv_start_cues(offset_t segment_offset) +static mkv_cues * mkv_start_cues(int64_t segment_offset) { mkv_cues *cues = av_mallocz(sizeof(mkv_cues)); if (cues == NULL) @@ -340,7 +340,7 @@ static mkv_cues * mkv_start_cues(offset_t segment_offset) return cues; } -static int mkv_add_cuepoint(mkv_cues *cues, AVPacket *pkt, offset_t cluster_pos) +static int mkv_add_cuepoint(mkv_cues *cues, AVPacket *pkt, int64_t cluster_pos) { mkv_cuepoint *entries = cues->entries; @@ -356,10 +356,10 @@ static int mkv_add_cuepoint(mkv_cues *cues, AVPacket *pkt, offset_t cluster_pos) return 0; } -static offset_t mkv_write_cues(ByteIOContext *pb, mkv_cues *cues, int num_tracks) +static int64_t mkv_write_cues(ByteIOContext *pb, mkv_cues *cues, int num_tracks) { ebml_master cues_element; - offset_t currentpos; + int64_t currentpos; int i, j; currentpos = url_ftell(pb); @@ -801,7 +801,7 @@ static int mkv_write_trailer(AVFormatContext *s) { MatroskaMuxContext *mkv = s->priv_data; ByteIOContext *pb = s->pb; - offset_t currentpos, second_seekhead, cuespos; + int64_t currentpos, second_seekhead, cuespos; int ret; end_ebml_master(pb, mkv->cluster); diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 3941bee14a..5e6d4ebccb 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -23,8 +23,8 @@ #include "riff.h" typedef struct { - offset_t atrpos, atsqpos, awapos; - offset_t data_size; + int64_t atrpos, atsqpos, awapos; + int64_t data_size; } MMFContext; static const int mmf_rates[] = { 4000, 8000, 11025, 22050, 44100 }; @@ -47,9 +47,9 @@ static int mmf_rate_code(int rate) } /* Copy of end_tag() from avienc.c, but for big-endian chunk size */ -static void end_tag_be(ByteIOContext *pb, offset_t start) +static void end_tag_be(ByteIOContext *pb, int64_t start) { - offset_t pos; + int64_t pos; pos = url_ftell(pb); url_fseek(pb, start - 4, SEEK_SET); @@ -61,7 +61,7 @@ static int mmf_write_header(AVFormatContext *s) { MMFContext *mmf = s->priv_data; ByteIOContext *pb = s->pb; - offset_t pos; + int64_t pos; int rate; rate = mmf_rate_code(s->streams[0]->codec->sample_rate); @@ -129,7 +129,7 @@ static int mmf_write_trailer(AVFormatContext *s) { ByteIOContext *pb = s->pb; MMFContext *mmf = s->priv_data; - offset_t pos, size; + int64_t pos, size; int gatetime; if (!url_is_streamed(s->pb)) { @@ -185,7 +185,7 @@ static int mmf_read_header(AVFormatContext *s, unsigned int tag; ByteIOContext *pb = s->pb; AVStream *st; - offset_t file_size, size; + int64_t file_size, size; int rate, params; tag = get_le32(pb); diff --git a/libavformat/mov.c b/libavformat/mov.c index 27ddb1c718..8ff964e3c5 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -211,7 +211,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) if (mov_default_parse_table[i].type == 0) { /* skip leaf atoms data */ url_fskip(pb, a.size); } else { - offset_t start_pos = url_ftell(pb); + int64_t start_pos = url_ftell(pb); int64_t left; err = mov_default_parse_table[i].parse(c, pb, a); if (url_is_streamed(pb) && c->found_moov && c->found_mdat) @@ -247,7 +247,7 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) for (i = 0; i < sc->drefs_count; i++) { MOV_dref_t *dref = &sc->drefs[i]; uint32_t size = get_be32(pb); - offset_t next = url_ftell(pb) + size - 4; + int64_t next = url_ftell(pb) + size - 4; dref->type = get_le32(pb); get_be32(pb); // version + flags @@ -723,7 +723,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) enum CodecID id; int dref_id; MOV_atom_t a = { 0, 0, 0 }; - offset_t start_pos = url_ftell(pb); + int64_t start_pos = url_ftell(pb); int size = get_be32(pb); /* size */ uint32_t format = get_le32(pb); /* data format */ @@ -1181,7 +1181,7 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) static void mov_build_index(MOVContext *mov, AVStream *st) { MOVStreamContext *sc = st->priv_data; - offset_t current_offset; + int64_t current_offset; int64_t current_dts = 0; unsigned int stts_index = 0; unsigned int stsc_index = 0; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 4463b6950c..9588bb6185 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -75,16 +75,16 @@ typedef struct MOVContext { int mode; int64_t time; int nb_streams; - offset_t mdat_pos; + int64_t mdat_pos; uint64_t mdat_size; long timescale; MOVTrack tracks[MAX_STREAMS]; } MOVContext; //FIXME support 64 bit variant with wide placeholders -static offset_t updateSize(ByteIOContext *pb, offset_t pos) +static int64_t updateSize(ByteIOContext *pb, int64_t pos) { - offset_t curpos = url_ftell(pb); + int64_t curpos = url_ftell(pb); url_fseek(pb, pos, SEEK_SET); put_be32(pb, curpos - pos); /* rewrite size */ url_fseek(pb, curpos, SEEK_SET); @@ -97,7 +97,7 @@ static int mov_write_stco_tag(ByteIOContext *pb, MOVTrack *track) { int i; int mode64 = 0; // use 32 bit size variant if possible - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ if (pos > UINT32_MAX) { mode64 = 1; @@ -121,7 +121,7 @@ static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack *track) int equalChunks = 1; int i, j, entries = 0, tst = -1, oldtst = -1; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "stsz"); put_be32(pb, 0); /* version & flags */ @@ -156,9 +156,9 @@ static int mov_write_stsz_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack *track) { int index = 0, oldval = -1, i; - offset_t entryPos, curpos; + int64_t entryPos, curpos; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "stsc"); put_be32(pb, 0); // version & flags @@ -185,9 +185,9 @@ static int mov_write_stsc_tag(ByteIOContext *pb, MOVTrack *track) /* Sync sample atom */ static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t curpos, entryPos; + int64_t curpos, entryPos; int i, index = 0; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); // size put_tag(pb, "stss"); put_be32(pb, 0); // version & flags @@ -300,7 +300,7 @@ static void putDescr(ByteIOContext *pb, int tag, unsigned int size) static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0; put_be32(pb, 0); // size @@ -354,7 +354,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic static int mov_write_wave_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "wave"); @@ -396,7 +396,7 @@ static int mov_write_glbl_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); int version = track->mode == MODE_MOV && (track->audio_vbr || track->enc->codec_id == CODEC_ID_PCM_S32LE || @@ -487,7 +487,7 @@ static int mov_write_svq3_tag(ByteIOContext *pb) static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); put_tag(pb, "avcC"); @@ -645,7 +645,7 @@ static int mov_write_uuid_tag_ipod(ByteIOContext *pb) static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); char compressor_name[32]; put_be32(pb, 0); /* size */ @@ -709,7 +709,7 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "stsd"); put_be32(pb, 0); /* version & flags */ @@ -812,7 +812,7 @@ static int mov_write_dref_tag(ByteIOContext *pb) static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "stbl"); mov_write_stsd_tag(pb, track); @@ -831,7 +831,7 @@ static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_dinf_tag(ByteIOContext *pb) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "dinf"); mov_write_dref_tag(pb); @@ -860,7 +860,7 @@ static int mov_write_vmhd_tag(ByteIOContext *pb) static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track) { const char *descr, *hdlr, *hdlr_type; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); if (!track) { /* no media --> data handler */ hdlr = "dhlr"; @@ -892,7 +892,7 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "minf"); if(track->enc->codec_type == CODEC_TYPE_VIDEO) @@ -938,7 +938,7 @@ static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack *track) static int mov_write_mdia_tag(ByteIOContext *pb, MOVTrack *track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "mdia"); mov_write_mdhd_tag(pb, track); @@ -1040,7 +1040,7 @@ static int mov_write_uuid_tag_psp(ByteIOContext *pb, MOVTrack *mov) static int mov_write_trak_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "trak"); mov_write_tkhd_tag(pb, track, st); @@ -1129,7 +1129,7 @@ static int mov_write_mvhd_tag(ByteIOContext *pb, MOVContext *mov) static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVContext *mov, AVFormatContext *s) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "hdlr"); put_be32(pb, 0); @@ -1146,7 +1146,7 @@ static int mov_write_itunes_hdlr_tag(ByteIOContext *pb, MOVContext *mov, static int mov_write_string_data_tag(ByteIOContext *pb, const char *data, int long_style) { if(long_style){ - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "data"); put_be32(pb, 1); @@ -1164,7 +1164,7 @@ static int mov_write_string_data_tag(ByteIOContext *pb, const char *data, int lo static int mov_write_string_tag(ByteIOContext *pb, const char *name, const char *value, int long_style){ int size = 0; if (value && value[0]) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, name); mov_write_string_data_tag(pb, value, long_style); @@ -1190,11 +1190,11 @@ static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext *mov, { int size = 0; if (s->track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "trkn"); { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "data"); put_be32(pb, 0); // 8 bytes empty @@ -1214,7 +1214,7 @@ static int mov_write_trkn_tag(ByteIOContext *pb, MOVContext *mov, static int mov_write_ilst_tag(ByteIOContext *pb, MOVContext *mov, AVFormatContext *s) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "ilst"); mov_write_string_tag(pb, "\251nam", s->title , 1); @@ -1239,7 +1239,7 @@ static int mov_write_meta_tag(ByteIOContext *pb, MOVContext *mov, // only save meta tag if required if (s->title[0] || s->author[0] || s->album[0] || s->year || s->comment[0] || s->genre[0] || s->track) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "meta"); put_be32(pb, 0); @@ -1280,7 +1280,7 @@ static uint16_t language_code(const char *str) static int mov_write_3gp_udta_tag(ByteIOContext *pb, AVFormatContext *s, const char *tag, const char *str) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); if (!utf8len(str)) return 0; put_be32(pb, 0); /* size */ @@ -1311,7 +1311,7 @@ static int mov_write_udta_tag(ByteIOContext *pb, MOVContext *mov, if (!bitexact && (s->title[0] || s->author[0] || s->album[0] || s->year || s->comment[0] || s->genre[0] || s->track)) { - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "udta"); @@ -1358,7 +1358,7 @@ static void mov_write_psp_udta_tag(ByteIOContext *pb, static int mov_write_uuidusmt_tag(ByteIOContext *pb, AVFormatContext *s) { - offset_t pos, pos2; + int64_t pos, pos2; if (s->title[0]) { pos = url_ftell(pb); @@ -1397,7 +1397,7 @@ static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov, AVFormatContext *s) { int i; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size placeholder*/ put_tag(pb, "moov"); mov->timescale = globalTimescale; @@ -1440,7 +1440,7 @@ static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext *mov) static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s) { MOVContext *mov = s->priv_data; - offset_t pos = url_ftell(pb); + int64_t pos = url_ftell(pb); int has_h264 = 0, has_video = 0; int minor = 0x200; int i; @@ -1732,7 +1732,7 @@ static int mov_write_trailer(AVFormatContext *s) int res = 0; int i; - offset_t moov_pos = url_ftell(pb); + int64_t moov_pos = url_ftell(pb); /* Write size of mdat tag */ if (mov->mdat_size+8 <= UINT32_MAX) { diff --git a/libavformat/mp3.c b/libavformat/mp3.c index efe494402b..407d4f00d7 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -224,7 +224,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t fl { int isv34, tlen; uint32_t tag; - offset_t next; + int64_t next; char tmp[16]; int taghdrlen; const char *reason; @@ -402,11 +402,11 @@ static int mp3_read_probe(AVProbeData *p) /** * Try to find Xing/Info/VBRI tags and compute duration from info therein */ -static void mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, offset_t base) +static void mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) { uint32_t v, spf; int frames = -1; /* Total number of frames in file */ - const offset_t xing_offtbl[2][2] = {{32, 17}, {17,9}}; + const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}}; MPADecodeContext c; v = get_be32(s->pb); @@ -452,7 +452,7 @@ static int mp3_read_header(AVFormatContext *s, AVStream *st; uint8_t buf[ID3v1_TAG_SIZE]; int len, ret, filesize; - offset_t off; + int64_t off; st = av_new_stream(s, 0); if (!st) diff --git a/libavformat/mxf.h b/libavformat/mxf.h index f4033de3dd..4c17a9ee85 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -46,7 +46,7 @@ enum MXFMetadataSetType { typedef struct { UID key; - offset_t offset; + int64_t offset; uint64_t length; } KLVPacket; diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 55dc5202ec..98cf41d35f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -238,7 +238,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b}; MXFContext *mxf = s->priv_data; ByteIOContext *pb = s->pb; - offset_t end = url_ftell(pb) + klv->length; + int64_t end = url_ftell(pb) + klv->length; uint64_t size; uint64_t orig_size; uint64_t plaintext_size; diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 5bca3d156b..5176f6dd0e 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -438,7 +438,7 @@ ogg_get_length (AVFormatContext * s) { ogg_t *ogg = s->priv_data; int idx = -1, i; - offset_t size, end; + int64_t size, end; if(url_is_streamed(s->pb)) return 0; diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 9233c72ad0..b3f1b9f253 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -36,9 +36,9 @@ typedef struct { int eos; } OGGStreamContext; -static void ogg_update_checksum(AVFormatContext *s, offset_t crc_offset) +static void ogg_update_checksum(AVFormatContext *s, int64_t crc_offset) { - offset_t pos = url_ftell(s->pb); + int64_t pos = url_ftell(s->pb); uint32_t checksum = get_checksum(s->pb); url_fseek(s->pb, crc_offset, SEEK_SET); put_be32(s->pb, checksum); @@ -49,7 +49,7 @@ static int ogg_write_page(AVFormatContext *s, const uint8_t *data, int size, int64_t granule, int stream_index, int flags) { OGGStreamContext *oggstream = s->streams[stream_index]->priv_data; - offset_t crc_offset; + int64_t crc_offset; int page_segments, i; if (size >= 255*255) { diff --git a/libavformat/raw.c b/libavformat/raw.c index 65d13aa785..058e922931 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -48,7 +48,7 @@ static int flac_write_trailer(struct AVFormatContext *s) ByteIOContext *pb = s->pb; uint8_t *streaminfo = s->streams[0]->codec->extradata; int len = s->streams[0]->codec->extradata_size; - offset_t file_size; + int64_t file_size; if (streaminfo && len > 0 && !url_is_streamed(s->pb)) { file_size = url_ftell(pb); diff --git a/libavformat/riff.c b/libavformat/riff.c index e00c9e131d..7b2682ae1e 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -215,16 +215,16 @@ const AVCodecTag codec_wav_tags[] = { }; #ifdef CONFIG_MUXERS -offset_t start_tag(ByteIOContext *pb, const char *tag) +int64_t start_tag(ByteIOContext *pb, const char *tag) { put_tag(pb, tag); put_le32(pb, 0); return url_ftell(pb); } -void end_tag(ByteIOContext *pb, offset_t start) +void end_tag(ByteIOContext *pb, int64_t start) { - offset_t pos; + int64_t pos; pos = url_ftell(pb); url_fseek(pb, start - 4, SEEK_SET); diff --git a/libavformat/riff.h b/libavformat/riff.h index 5fdb370d71..bd4e9f16ae 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -31,8 +31,8 @@ #include "libavcodec/avcodec.h" #include "avio.h" -offset_t start_tag(ByteIOContext *pb, const char *tag); -void end_tag(ByteIOContext *pb, offset_t start); +int64_t start_tag(ByteIOContext *pb, const char *tag); +void end_tag(ByteIOContext *pb, int64_t start); typedef struct AVCodecTag { int id; diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 1ea296db95..27ff06bc28 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -36,7 +36,7 @@ typedef struct { int stream; - offset_t sample_offset; + int64_t sample_offset; unsigned int sample_size; int64_t pts; int keyframe; diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 20c4f58022..0a5f2fa581 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -34,7 +34,7 @@ typedef struct { int stream_index; - offset_t frame_offset; + int64_t frame_offset; unsigned int frame_size; int64_t pts; int keyframe; @@ -77,7 +77,7 @@ static int vmd_read_header(AVFormatContext *s, unsigned int toc_offset; unsigned char *raw_frame_table; int raw_frame_table_size; - offset_t current_offset; + int64_t current_offset; int i, j; unsigned int total_frames; int64_t pts_inc = 1; diff --git a/libavformat/smacker.c b/libavformat/smacker.c index d11bddc145..3aa08bda1a 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -64,7 +64,7 @@ typedef struct SmackerContext { int buf_sizes[7]; int stream_id[7]; int curstream; - offset_t nextpos; + int64_t nextpos; int64_t aud_pts[7]; } SmackerContext; diff --git a/libavformat/swf.h b/libavformat/swf.h index a138987ca4..93377dcccf 100644 --- a/libavformat/swf.h +++ b/libavformat/swf.h @@ -66,9 +66,9 @@ typedef struct { int audio_stream_index; - offset_t duration_pos; - offset_t tag_pos; - offset_t vframes_pos; + int64_t duration_pos; + int64_t tag_pos; + int64_t vframes_pos; int samples_per_frame; int sound_samples; int swf_frame_number; diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c index 2d341dcc47..52e3c7270f 100644 --- a/libavformat/swfenc.c +++ b/libavformat/swfenc.c @@ -44,7 +44,7 @@ static void put_swf_end_tag(AVFormatContext *s) { SWFContext *swf = s->priv_data; ByteIOContext *pb = s->pb; - offset_t pos; + int64_t pos; int tag_len, tag; pos = url_ftell(pb); diff --git a/libavformat/utils.c b/libavformat/utils.c index f6101e33b4..1f1a174a04 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1701,7 +1701,7 @@ static void av_estimate_timings_from_bit_rate(AVFormatContext *ic) #define DURATION_MAX_READ_SIZE 250000 /* only usable for MPEG-PS streams */ -static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offset) +static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset) { AVPacket pkt1, *pkt = &pkt1; AVStream *st; @@ -1794,7 +1794,7 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offse } } -static void av_estimate_timings(AVFormatContext *ic, offset_t old_offset) +static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset) { int64_t file_size; @@ -2003,7 +2003,7 @@ int av_find_stream_info(AVFormatContext *ic) int64_t last_dts[MAX_STREAMS]; int duration_count[MAX_STREAMS]={0}; double (*duration_error)[MAX_STD_TIMEBASES]; - offset_t old_offset = url_ftell(ic->pb); + int64_t old_offset = url_ftell(ic->pb); int64_t codec_info_duration[MAX_STREAMS]={0}; int codec_info_nb_frames[MAX_STREAMS]={0}; diff --git a/libavformat/wav.c b/libavformat/wav.c index ba7315b360..01923d5aad 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -23,8 +23,8 @@ #include "riff.h" typedef struct { - offset_t data; - offset_t data_end; + int64_t data; + int64_t data_end; int64_t minpts; int64_t maxpts; int last_duration; @@ -35,7 +35,7 @@ static int wav_write_header(AVFormatContext *s) { WAVContext *wav = s->priv_data; ByteIOContext *pb = s->pb; - offset_t fmt, fact; + int64_t fmt, fact; put_tag(pb, "RIFF"); put_le32(pb, 0); /* file length */ @@ -88,7 +88,7 @@ static int wav_write_trailer(AVFormatContext *s) { ByteIOContext *pb = s->pb; WAVContext *wav = s->priv_data; - offset_t file_size; + int64_t file_size; if (!url_is_streamed(s->pb)) { end_tag(pb, wav->data); |