From cf98c303d840eb02be5c11dd4a3505a58413dfa4 Mon Sep 17 00:00:00 2001 From: thlo Date: Mon, 4 Feb 2013 18:33:49 +0100 Subject: Large File Support fixed. Fixed VDR dir identification. --- vdr-smarttvweb/httpresource.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'vdr-smarttvweb/httpresource.c') diff --git a/vdr-smarttvweb/httpresource.c b/vdr-smarttvweb/httpresource.c index 5313b6a..47fce70 100755 --- a/vdr-smarttvweb/httpresource.c +++ b/vdr-smarttvweb/httpresource.c @@ -1086,6 +1086,7 @@ int cHttpResource::parseFiles(vector *entries, string prefix, string // char [20] rest; int start = -1; sscanf(de->d_name, "%4d-%02d-%02d.%02d.%02d", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min); + // sscanf(de->d_name, "%4d-%02d-%02d.%02d%.%02d", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min); t.tm_year -= 1900; t.tm_mon--; @@ -2387,8 +2388,9 @@ int cHttpResource::sendVdrDir(struct stat *statbuf) { mVdrIdx = 1; mFileStructure = "%s/%03d.vdr"; - if (mPath.compare(mPath.size() - 9, 9, "99.99.rec") != 0) { - mFileStructure = "%s/%05d.ts"; + snprintf(pathbuf, sizeof(pathbuf), mFileStructure.c_str(), mPath.c_str(), 1); + if (stat(pathbuf, statbuf) < 0) { + mFileStructure = "%s/%05d.ts"; #ifndef DEBUG *(mLog->log())<< DEBUGPREFIX << " using dir format: " << mFileStructure.c_str() << endl; #endif @@ -2620,15 +2622,22 @@ int cHttpResource::sendFile(struct stat *statbuf32) { mFileSize = S_ISREG(statbuf.st_mode) ? statbuf.st_size : -1; + *(mLog->log())<< "fd= " << mFd << " mReqId= "<< mReqId + << " mFileSize= " <log())<< "fd= " << mFd << " mReqId= "<< mReqId + << " rangeHdr.begin= " <