[Ffmpeg-devel] [PATCH] Fix url_fsize for large files

Wolfram Gloger wmglo
Mon May 30 08:41:29 CEST 2005


Hi,

Since url_fsize is implemented in terms of ByteIOContext::seek,
that function needs to become large-file aware.

Regards,
Wolfram.

diff -ur ffmpeg/libavformat/avio.h ffmpeg-wg/libavformat/avio.h
--- ffmpeg/libavformat/avio.h	2005-05-23 09:53:36.000000000 +0200
+++ ffmpeg-wg/libavformat/avio.h	2005-05-29 15:31:47.000000000 +0200
@@ -71,7 +71,7 @@
     void *opaque;
     int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
     int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*seek)(void *opaque, offset_t offset, int whence);
+    offset_t (*seek)(void *opaque, offset_t offset, int whence);
     offset_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 */
@@ -91,7 +91,7 @@
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*seek)(void *opaque, offset_t offset, int whence));
+                  offset_t (*seek)(void *opaque, offset_t offset, int whence));
 
 void put_byte(ByteIOContext *s, int b);
 void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
diff -ur ffmpeg/libavformat/aviobuf.c ffmpeg-wg/libavformat/aviobuf.c
--- ffmpeg/libavformat/aviobuf.c	2005-05-23 09:53:36.000000000 +0200
+++ ffmpeg-wg/libavformat/aviobuf.c	2005-05-29 15:42:42.000000000 +0200
@@ -29,7 +29,7 @@
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*seek)(void *opaque, offset_t offset, int whence))
+                  offset_t (*seek)(void *opaque, offset_t offset, int whence))
 {
     s->buffer = buffer;
     s->buffer_size = buffer_size;
@@ -491,7 +491,7 @@
     return url_read(h, buf, buf_size);
 }
 
-static int url_seek_packet(void *opaque, int64_t offset, int whence)
+static offset_t url_seek_packet(void *opaque, offset_t offset, int whence)
 {
     URLContext *h = opaque;
     return url_seek(h, offset, whence);
@@ -701,7 +701,7 @@
     return dyn_buf_write(opaque, buf, buf_size);
 }
 
-static int dyn_buf_seek(void *opaque, offset_t offset, int whence)
+static offset_t dyn_buf_seek(void *opaque, offset_t offset, int whence)
 {
     DynBuffer *d = opaque;
 





More information about the ffmpeg-devel mailing list