comparison http.c @ 6115:4c91cdcb8a52 libavformat

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.
author mstorsjo
date Wed, 09 Jun 2010 08:29:51 +0000
parents d3cfb2687491
children f221641c262a
comparison
equal deleted inserted replaced
6114:10c9d304794f 6115:4c91cdcb8a52
478 URLContext *old_hd = s->hd; 478 URLContext *old_hd = s->hd;
479 int64_t old_off = s->off; 479 int64_t old_off = s->off;
480 uint8_t old_buf[BUFFER_SIZE]; 480 uint8_t old_buf[BUFFER_SIZE];
481 int old_buf_size; 481 int old_buf_size;
482 482
483 if (!s->init) {
484 int ret = http_open_cnx(h);
485 if (ret != 0)
486 return ret;
487 }
488
483 if (whence == AVSEEK_SIZE) 489 if (whence == AVSEEK_SIZE)
484 return s->filesize; 490 return s->filesize;
485 else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed) 491 else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
486 return -1; 492 return -1;
487 493