aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <felix.domke@multimedia-labs.de>2009-12-23 12:57:45 +0100
committerFelix Domke <felix.domke@multimedia-labs.de>2009-12-23 12:57:45 +0100
commit2026a6353de4bb4f8586b47963282b8eb14114b1 (patch)
treec2cecb9f15de53ee7ce7acae0b3718e696cdfcf8
parentee9a89efd6533997e3dc9a4e8adcb360333d01d9 (diff)
downloadenigma2-2026a6353de4bb4f8586b47963282b8eb14114b1.tar.gz
enigma2-2026a6353de4bb4f8586b47963282b8eb14114b1.zip
Patch by Moritz Venn:
"I've been annoyed by the incomplete "sort by date" for a long time - it only works for recorded movies. Not much to say, I added a simple stat call in service.cpp and return the mtime for sTimeCreate so the list is as properly sorted as the dreambox can ;-)" Minor changes so that it is implemented in servicemp3.cpp, since a service reference "path" is specific to the actual service.
-rw-r--r--lib/service/servicemp3.cpp19
-rw-r--r--lib/service/servicemp3.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp
index d3eaa262..47511f78 100644
--- a/lib/service/servicemp3.cpp
+++ b/lib/service/servicemp3.cpp
@@ -189,6 +189,25 @@ int eStaticServiceMP3Info::getLength(const eServiceReference &ref)
return -1;
}
+int eStaticServiceMP3Info::getInfo(const eServiceReference &ref, int w)
+{
+ switch (w)
+ {
+ case iServiceInformation::sTimeCreate:
+ {
+ struct stat s;
+ if(stat(ref.path.c_str(), &s) == 0)
+ {
+ return s.st_mtime;
+ }
+ return iServiceInformation::resNA;
+ }
+ default: break;
+ }
+ return iServiceInformation::resNA;
+}
+
+
// eServiceMP3
int eServiceMP3::ac3_delay,
eServiceMP3::pcm_delay;
diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h
index 985179f6..56a068b9 100644
--- a/lib/service/servicemp3.h
+++ b/lib/service/servicemp3.h
@@ -41,6 +41,7 @@ class eStaticServiceMP3Info: public iStaticServiceInformation
public:
RESULT getName(const eServiceReference &ref, std::string &name);
int getLength(const eServiceReference &ref);
+ int getInfo(const eServiceReference &ref, int w);
};
typedef struct _GstElement GstElement;