summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthlo <t.lohmar@gmx.de>2013-01-20 22:05:31 +0100
committerthlo <t.lohmar@gmx.de>2013-01-20 22:05:31 +0100
commitbdfc63bbfab0674c9626a863a90fb2c287ef48bc (patch)
tree72d7f3a4811f47e124604dacdc28e23f8e630573
parentdacf1012deaab969d17e4d0ada33abd976dde6be (diff)
downloadvdr-plugin-smarttvweb-bdfc63bbfab0674c9626a863a90fb2c287ef48bc.tar.gz
vdr-plugin-smarttvweb-bdfc63bbfab0674c9626a863a90fb2c287ef48bc.tar.bz2
Resume Fixes
-rwxr-xr-xvdr-smarttvweb/httpresource.c32
-rwxr-xr-xvdr-smarttvweb/httpresource.h3
-rw-r--r--vdr-smarttvweb/smarttvfactory.h3
-rw-r--r--vdr-smarttvweb/smarttvweb.c2
4 files changed, 25 insertions, 15 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
diff --git a/vdr-smarttvweb/httpresource.h b/vdr-smarttvweb/httpresource.h
index fef59ce..74765de 100755
--- a/vdr-smarttvweb/httpresource.h
+++ b/vdr-smarttvweb/httpresource.h
@@ -144,7 +144,8 @@ class cHttpResource {
int sendVdrDir(struct stat *statbuf);
int sendRecordingsXml (struct stat *statbuf);
int sendChannelsXml (struct stat *statbuf);
- int sendResumeXml (struct stat *statbuf);
+ int sendResumeXml ();
+ // int sendResumeXml (struct stat *statbuf);
int sendEpgXml (struct stat *statbuf);
int sendMediaXml (struct stat *statbuf);
diff --git a/vdr-smarttvweb/smarttvfactory.h b/vdr-smarttvweb/smarttvfactory.h
index ff1af24..644427a 100644
--- a/vdr-smarttvweb/smarttvfactory.h
+++ b/vdr-smarttvweb/smarttvfactory.h
@@ -38,6 +38,9 @@
using namespace std;
+#define PLG_VERSION "0.9.3"
+#define SERVER "SmartTvWeb/0.9.3"
+
class SmartTvServer {
public:
SmartTvServer();
diff --git a/vdr-smarttvweb/smarttvweb.c b/vdr-smarttvweb/smarttvweb.c
index f64b52e..9e3269e 100644
--- a/vdr-smarttvweb/smarttvweb.c
+++ b/vdr-smarttvweb/smarttvweb.c
@@ -41,7 +41,7 @@
#include "smarttvfactory.h"
-static const char *VERSION = "0.9.2";
+static const char *VERSION = PLG_VERSION;
static const char *DESCRIPTION = "SmartTV Web Server";