1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-08 18:35:45 +02:00

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
This commit is contained in:
Martin Storsjö 2010-06-09 08:29:51 +00:00
parent d5cc1ed723
commit bdb57a9198

View File

@ -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)