diff aviobuf.c @ 764:cdb845a57ae4 libavformat

drop most url_fileno() calls (allows to use ByteIOContext directly in caller apps instead of URLProtocol)
author aurel
date Thu, 19 May 2005 00:06:27 +0000
parents 0ab9b7331748
children 4fbe04f998bf
line wrap: on
line diff
--- a/aviobuf.c	Tue May 17 22:47:34 2005 +0000
+++ b/aviobuf.c	Thu May 19 00:06:27 2005 +0000
@@ -172,6 +172,17 @@
     return url_fseek(s, 0, SEEK_CUR);
 }
 
+offset_t url_fsize(ByteIOContext *s)
+{
+    offset_t size;
+    
+    if (!s->seek)
+        return -EPIPE;
+    size = s->seek(s->opaque, -1, SEEK_END) + 1;
+    s->seek(s->opaque, s->pos, SEEK_SET);
+    return size;
+}
+
 int url_feof(ByteIOContext *s)
 {
     return s->eof_reached;