changeset 3277:ce8070648576 libavformat

Check url_seek() in url_open().
author michael
date Mon, 05 May 2008 09:17:56 +0000
parents 24284961452b
children 1de87c1b6a12
files avio.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/avio.c	Sun May 04 10:35:13 2008 +0000
+++ b/avio.c	Mon May 05 09:17:56 2008 +0000
@@ -113,6 +113,12 @@
         *puc = NULL;
         return err;
     }
+
+    //We must be carefull here as url_seek() could be slow, for example for http
+    if(   (flags & (URL_WRONLY | URL_RDWR))
+       || !strcmp(proto_str, "file"))
+        if(!uc->is_streamed && url_seek(uc, 0, SEEK_SET) < 0)
+            uc->is_streamed= 1;
     *puc = uc;
     return 0;
  fail: