summaryrefslogtreecommitdiff
path: root/vdr-smarttvweb/httpresource.c
diff options
context:
space:
mode:
authorthlo <smarttv640@gmail.com>2013-01-20 22:05:31 +0100
committerthlo <t.lohmar@gmx.de>2013-01-20 22:05:31 +0100
commit9bf91b278fb71ddb118c5df18a894eff647c1ebd (patch)
tree72d7f3a4811f47e124604dacdc28e23f8e630573 /vdr-smarttvweb/httpresource.c
parent9ad252e42b22a09dcee515d63e297ca758b2b54a (diff)
downloadvdr-plugin-smarttvweb-9bf91b278fb71ddb118c5df18a894eff647c1ebd.tar.gz
vdr-plugin-smarttvweb-9bf91b278fb71ddb118c5df18a894eff647c1ebd.tar.bz2
Resume Fixes
Diffstat (limited to 'vdr-smarttvweb/httpresource.c')
-rwxr-xr-xvdr-smarttvweb/httpresource.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/vdr-smarttvweb/httpresource.c b/vdr-smarttvweb/httpresource.c
index 6ecea21..7356368 100755
--- a/vdr-smarttvweb/httpresource.c
+++ b/vdr-smarttvweb/httpresource.c
@@ -50,7 +50,6 @@
#include <vdr/epg.h>
#endif
-#define SERVER "SmartTvWeb/0.2"
#define PROTOCOL "HTTP/1.1"
#define RFC1123FMT "%a, %d %b %Y %H:%M:%S GMT"
@@ -362,13 +361,6 @@ int cHttpResource::processRequest() {
sendEpgXml( &statbuf);
return OKAY;
}
- if (mPath.compare("/resume.xml") == 0) {
- if (handleHeadRequest() != 0)
- return OKAY;
-
- sendResumeXml( &statbuf);
- return OKAY;
- }
#endif
if (mPath.compare("/media.xml") == 0) {
@@ -754,7 +746,17 @@ int cHttpResource::handlePost() {
<< endl;
}
- if (mPath.compare("/resume") == 0) {
+ if (mPath.compare("/getResume.xml") == 0) {
+ if (handleHeadRequest() != 0)
+ return OKAY;
+
+ // sendResumeXml( &statbuf);
+ sendResumeXml( );
+ return OKAY;
+ }
+
+
+ if (mPath.compare("/setResume.xml") == 0) {
string dev_id;
cResumeEntry entry;
@@ -1681,7 +1683,8 @@ int cHttpResource::sendChannelsXml (struct stat *statbuf) {
return OKAY;
}
-int cHttpResource::sendResumeXml (struct stat *statbuf) {
+//int cHttpResource::sendResumeXml (struct stat *statbuf) {
+int cHttpResource::sendResumeXml () {
#ifndef STANDALONE
mResponseMessage = new string();
@@ -1695,12 +1698,14 @@ int cHttpResource::sendResumeXml (struct stat *statbuf) {
cResumeEntry entry;
string id;
- parseResume(entry, id);
+ parseResume(entry, id);
cRecording *rec = Recordings.GetByName(entry.mFilename.c_str());
if (rec == NULL) {
//Error 404
+ *(mLog->log())<< DEBUGPREFIX
+ << " sendResume: File Not Found filename= " << entry.mFilename << endl;
sendError(404, "Not Found", NULL, "Failed to find recording.");
return OKAY;
}
@@ -1713,12 +1718,13 @@ int cHttpResource::sendResumeXml (struct stat *statbuf) {
<< endl;
*mResponseMessage += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- *mResponseMessage += "<resume>\n";
+ *mResponseMessage += "<resume>";
snprintf(f, sizeof(f), "%.02f", resume.Read() *1.0 / rec->FramesPerSecond());
*mResponseMessage += f;
*mResponseMessage += "</resume>\n";
- sendHeaders(200, "OK", NULL, "application/xml", mResponseMessage->size(), statbuf->st_mtime);
+
+ sendHeaders(200, "OK", NULL, "application/xml", mResponseMessage->size(), -1);
return OKAY;
#endif