Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protocol option 'seekable' for CurlFile (http/https). #2521

Merged
merged 1 commit into from Apr 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions xbmc/filesystem/CurlFile.cpp
Expand Up @@ -770,6 +770,8 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
SetContentEncoding(value);
else if (name.Equals("noshout") && value.Equals("true"))
m_skipshout = true;
else if (name.Equals("seekable") && value.Equals("0"))
m_seekable = false;
else
SetRequestHeader(name, value);
}
Expand Down Expand Up @@ -892,6 +894,7 @@ bool CCurlFile::Open(const CURL& url)
if( m_state->m_easyHandle == NULL )
g_curlInterface.easy_aquire(url2.GetProtocol(), url2.GetHostName(), &m_state->m_easyHandle, &m_state->m_multiHandle );

m_seekable = true;
// setup common curl options
SetCommonOptions(m_state);
SetRequestHeaders(m_state);
Expand Down Expand Up @@ -932,11 +935,10 @@ bool CCurlFile::Open(const CURL& url)
if(m_state->m_httpheader.GetValue("Transfer-Encoding").Equals("chunked"))
m_state->m_fileSize = 0;

m_seekable = false;
if(m_state->m_fileSize > 0)
if(m_state->m_fileSize <= 0)
m_seekable = false;
if (m_seekable)
{
m_seekable = true;

if(url2.GetProtocol().Equals("http")
|| url2.GetProtocol().Equals("https"))
{
Expand Down