diff aviobuf.c @ 1612:a6eaa0762191 libavformat

seekless filesize retrieving support in 7 lines of code, also doesnt break compatibility
author michael
date Mon, 01 Jan 2007 21:49:09 +0000
parents 11d73c89043a
children 387dc458ba37
line wrap: on
line diff
--- a/aviobuf.c	Mon Jan 01 21:17:14 2007 +0000
+++ b/aviobuf.c	Mon Jan 01 21:49:09 2007 +0000
@@ -170,8 +170,11 @@
 
     if (!s->seek)
         return -EPIPE;
+    size = s->seek(s->opaque, 0, AVSEEK_SIZE);
+    if(size<0){
     size = s->seek(s->opaque, -1, SEEK_END) + 1;
     s->seek(s->opaque, s->pos, SEEK_SET);
+    }
     return size;
 }