avformat/http: always allow no-op seek

This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
This commit is contained in:
Anssi Hannula 2013-12-30 12:46:32 +02:00
parent 0588acaffa
commit 857841c1b6
1 changed files with 2 additions and 0 deletions

View File

@ -947,6 +947,8 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
if (whence == AVSEEK_SIZE)
return s->filesize;
else if ((whence == SEEK_CUR && off == 0) || (whence == SEEK_SET && off == s->off))
return s->off;
else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
return -1;