summaryrefslogtreecommitdiff
path: root/libs/mediaScan/src/Movie.cc
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-08-02 06:07:59 (GMT)
committergeronimo <geronimo013@gmx.de>2012-08-02 06:07:59 (GMT)
commitadb7d83292e1502ca7c21a123b104412cb22d160 (patch)
treeecb448802df0d35f1c3289c4f0e7c246ee5c021a /libs/mediaScan/src/Movie.cc
parent5416f2e39cfedc474c87e0a3eeff067fbb25dceb (diff)
downloadcmp-adb7d83292e1502ca7c21a123b104412cb22d160.tar.gz
cmp-adb7d83292e1502ca7c21a123b104412cb22d160.tar.bz2
worked out processing of some meta data, extended json list elements
Diffstat (limited to 'libs/mediaScan/src/Movie.cc')
-rw-r--r--libs/mediaScan/src/Movie.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/libs/mediaScan/src/Movie.cc b/libs/mediaScan/src/Movie.cc
index d161dfe..51d1ff9 100644
--- a/libs/mediaScan/src/Movie.cc
+++ b/libs/mediaScan/src/Movie.cc
@@ -25,6 +25,7 @@
#include <Movie.h>
#include <stddef.h>
#include <string.h>
+#include <util.h>
static bool deepScanEnabled = true;
@@ -64,8 +65,16 @@ const char *cMovie::ContentType(const char* Extension)
void cMovie::AddMeta(cMediainfoReader::InfoEntry *Entry)
{
- if (!strcmp("Scan type", std::get<0>(*Entry).c_str())) {
- if (!strcmp("Interlaced", std::get<1>(*Entry).c_str())) SetMediaType(MediaType() + 1);
+ if (!Entry) return;
+ std::string name = std::get<0>(*Entry);
+ std::string value = std::get<1>(*Entry);
+
+ if (!strcmp("Scan type", name.c_str())) {
+ if (!strcmp("Interlaced", value.c_str())) SetMediaType(MediaType() + 1);
+ }
+ else if (!strcmp("Aspect", name.c_str())) {
+ aspect = parseAspect(value);
+ if (height > 0 && width > 0) width = height * aspect;
}
cAbstractMedia::AddMeta(Entry);
}
@@ -79,3 +88,10 @@ bool cMovie::NeedsFurtherScan(void) const
{
return deepScanEnabled;
}
+
+void cMovie::SetFormat(const char* Format) {
+ if (!strcmp("Matroska", Format) || !strcmp("Flash Video", Format)
+ || !strcmp("MPEG-PS", Format) || !strcmp("MPEG-TS", Format) || !strcmp("MPEG-PES", Format))
+ return; // skip containers
+ cAbstractMedia::SetFormat(Format);
+} \ No newline at end of file