]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.c
h264_probe()
[ffmpeg] / libavformat / avio.c
index b6478c4f3b717f0514d23b23d4f53dee3437f451..743cc88e98a6ad82dc11570c4b76247831daf40f 100644 (file)
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#include "libavutil/avstring.h"
+#include "libavcodec/opt.h"
 #include "avformat.h"
-#include "avstring.h"
-#include "opt.h"
 
 #if LIBAVFORMAT_VERSION_MAJOR >= 53
 /** @name Logging context. */
@@ -113,6 +114,12 @@ int url_open(URLContext **puc, const char *filename, int flags)
         *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: