summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-18 20:46:12 +0100
committerwm4 <wm4@nowhere>2012-11-20 18:00:15 +0100
commitddffcce67810fbde5508a353f85760da7a1b4a95 (patch)
tree74d9b416568c12759a0c198651bce0e78a0c2284 /stream/stream.h
parent51dac4e0702e361b88e5a373fbb0165f5ad47420 (diff)
downloadmpv-ddffcce67810fbde5508a353f85760da7a1b4a95.tar.bz2
mpv-ddffcce67810fbde5508a353f85760da7a1b4a95.tar.xz
stream, demux: replace off_t with int64_t
On reasonable systems, these types were the same anyway. Even on unreasonable systems (seriously, which?), this may reduce potential breakage.
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/stream/stream.h b/stream/stream.h
index ace35abd9a..9023c95933 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -118,7 +118,7 @@ typedef struct streaming_control {
unsigned int buffer_pos;
unsigned int bandwidth; // The downstream available
int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
- int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
+ int (*streaming_seek)( int fd, int64_t pos, struct streaming_control *stream_ctrl );
void *data;
// hacks for asf
int *audio_id_ptr;
@@ -148,7 +148,7 @@ typedef struct stream {
// Write
int (*write_buffer)(struct stream *s, char* buffer, int len);
// Seek
- int (*seek)(struct stream *s,off_t pos);
+ int (*seek)(struct stream *s,int64_t pos);
// Control
// Will be later used to let streams like dvd and cdda report
// their structure (ie tracks, chapters, etc)
@@ -162,7 +162,7 @@ typedef struct stream {
int sector_size; // sector size (seek will be aligned on this size if non 0)
int read_chunk; // maximum amount of data to read at once to limit latency (0 for default)
unsigned int buf_pos,buf_len;
- off_t pos,start_pos,end_pos;
+ int64_t pos,start_pos,end_pos;
int eof;
int mode; //STREAM_READ or STREAM_WRITE
unsigned int cache_pid;
@@ -182,7 +182,7 @@ typedef struct stream {
#endif
int stream_fill_buffer(stream_t *s);
-int stream_seek_long(stream_t *s, off_t pos);
+int stream_seek_long(stream_t *s, int64_t pos);
#ifdef CONFIG_STREAM_CACHE
int stream_enable_cache_percent(stream_t *stream, int64_t stream_cache_size,
@@ -294,11 +294,11 @@ inline static int stream_eof(stream_t *s){
return s->eof;
}
-inline static off_t stream_tell(stream_t *s){
+inline static int64_t stream_tell(stream_t *s){
return s->pos+s->buf_pos-s->buf_len;
}
-inline static int stream_seek(stream_t *s,off_t pos){
+inline static int stream_seek(stream_t *s,int64_t pos){
mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%llX\n", (long long)pos);
@@ -308,7 +308,7 @@ inline static int stream_seek(stream_t *s,off_t pos){
pos = 0;
}
if(pos<s->pos){
- off_t x=pos-(s->pos-s->buf_len);
+ int64_t x=pos-(s->pos-s->buf_len);
if(x>=0){
s->buf_pos=x;
s->eof = 0;
@@ -320,7 +320,7 @@ inline static int stream_seek(stream_t *s,off_t pos){
return cache_stream_seek_long(s,pos);
}
-inline static int stream_skip(stream_t *s,off_t len){
+inline static int stream_skip(stream_t *s,int64_t len){
if( len<0 || (len>2*STREAM_BUFFER_SIZE && (s->flags & MP_STREAM_SEEK_FW)) ) {
// negative or big skip!
return stream_seek(s,stream_tell(s)+len);
@@ -371,7 +371,7 @@ int stream_check_interrupt(int time);
/// Internal read function bypassing the stream buffer
int stream_read_internal(stream_t *s, void *buf, int len);
/// Internal seek function bypassing the stream buffer
-int stream_seek_internal(stream_t *s, off_t newpos);
+int stream_seek_internal(stream_t *s, int64_t newpos);
extern int bluray_angle;
extern int bluray_chapter;