Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-06-09 12:29:51 +0400
committerMartin Storsjö <martin@martin.st>2010-06-09 12:29:51 +0400
commitbdb57a9198993a6c1fb9175d2e94083ad8ee0380 (patch)
treeb09c124425df5561e10b3f69701225ea58df6751 /libavformat/http.c
parentd5cc1ed723cfbbf71ea005ce1a2e2f5b55a9f631 (diff)
Initialize the http connection in http_seek, too
This makes url_fsize return correct values for delay opened connections that have not yet been initialized. This fixes using the image2 demuxer with http sources. Originally committed as revision 23546 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 34a3242051..ef55bb0ad8 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -480,6 +480,12 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
uint8_t old_buf[BUFFER_SIZE];
int old_buf_size;
+ if (!s->init) {
+ int ret = http_open_cnx(h);
+ if (ret != 0)
+ return ret;
+ }
+
if (whence == AVSEEK_SIZE)
return s->filesize;
else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)