summaryrefslogtreecommitdiff
path: root/libs/mediaScan/src
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-31 04:55:28 (GMT)
committergeronimo <geronimo013@gmx.de>2012-07-31 04:55:28 (GMT)
commit1d4bb88ac1927be040d1900bb2e1b0788e648b44 (patch)
tree77ee9def3d30d9234ba5d9f1064e656dc2f30e00 /libs/mediaScan/src
parentcedb1ef9230b87b7f92bbec39970a0fccb49bb56 (diff)
downloadcmp-1d4bb88ac1927be040d1900bb2e1b0788e648b44.tar.gz
cmp-1d4bb88ac1927be040d1900bb2e1b0788e648b44.tar.bz2
fixed error in mediainfo-scanner, removed all code::blocks stuff, as it resulted being not reliable
Diffstat (limited to 'libs/mediaScan/src')
-rw-r--r--libs/mediaScan/src/AbstractMedia.cc2
-rw-r--r--libs/mediaScan/src/AbstractMultiFileMovie.cc2
-rw-r--r--libs/mediaScan/src/Audio.cc2
-rw-r--r--libs/mediaScan/src/DVDImage.cc2
-rw-r--r--libs/mediaScan/src/FSMediaScanner.cc2
-rw-r--r--libs/mediaScan/src/LegacyVdrRecording.cc2
-rw-r--r--libs/mediaScan/src/MediaFactory.cc2
-rw-r--r--libs/mediaScan/src/MediainfoReader.cc52
-rw-r--r--libs/mediaScan/src/Movie.cc2
-rw-r--r--libs/mediaScan/src/Picture.cc2
-rw-r--r--libs/mediaScan/src/VdrRecording.cc2
11 files changed, 44 insertions, 28 deletions
diff --git a/libs/mediaScan/src/AbstractMedia.cc b/libs/mediaScan/src/AbstractMedia.cc
index 924f01a..98c72bb 100644
--- a/libs/mediaScan/src/AbstractMedia.cc
+++ b/libs/mediaScan/src/AbstractMedia.cc
@@ -4,7 +4,7 @@
* File: AbstractMedia.cc
* Created: 2. Juli 2012, 14
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/AbstractMultiFileMovie.cc b/libs/mediaScan/src/AbstractMultiFileMovie.cc
index f679511..7ff8b10 100644
--- a/libs/mediaScan/src/AbstractMultiFileMovie.cc
+++ b/libs/mediaScan/src/AbstractMultiFileMovie.cc
@@ -4,7 +4,7 @@
* File: AbstractMultiFileMovie.cc
* Created: 3. Juli 2012, 07
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/Audio.cc b/libs/mediaScan/src/Audio.cc
index 6c90fbc..a17517f 100644
--- a/libs/mediaScan/src/Audio.cc
+++ b/libs/mediaScan/src/Audio.cc
@@ -4,7 +4,7 @@
* File: Audio.cc
* Created: 2. Juli 2012, 15
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/DVDImage.cc b/libs/mediaScan/src/DVDImage.cc
index 0d23ae1..1df6d1e 100644
--- a/libs/mediaScan/src/DVDImage.cc
+++ b/libs/mediaScan/src/DVDImage.cc
@@ -4,7 +4,7 @@
* File: DVDImage.cc
* Created: 3. Juli 2012, 08
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/FSMediaScanner.cc b/libs/mediaScan/src/FSMediaScanner.cc
index f4ac14e..2df5907 100644
--- a/libs/mediaScan/src/FSMediaScanner.cc
+++ b/libs/mediaScan/src/FSMediaScanner.cc
@@ -4,7 +4,7 @@
* File: FSMediaScanner.cc
* Created: 2. Juli 2012, 13
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/LegacyVdrRecording.cc b/libs/mediaScan/src/LegacyVdrRecording.cc
index 5ee635c..3c74b6e 100644
--- a/libs/mediaScan/src/LegacyVdrRecording.cc
+++ b/libs/mediaScan/src/LegacyVdrRecording.cc
@@ -4,7 +4,7 @@
* File: LegacyVdrRecording.cc
* Created: 3. Juli 2012, 08
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/MediaFactory.cc b/libs/mediaScan/src/MediaFactory.cc
index 4dec763..0af2fae 100644
--- a/libs/mediaScan/src/MediaFactory.cc
+++ b/libs/mediaScan/src/MediaFactory.cc
@@ -4,7 +4,7 @@
* File: MediaFactory.cc
* Created: 2. Juli 2012, 15
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/MediainfoReader.cc b/libs/mediaScan/src/MediainfoReader.cc
index cd1f3f6..e55b8d9 100644
--- a/libs/mediaScan/src/MediainfoReader.cc
+++ b/libs/mediaScan/src/MediainfoReader.cc
@@ -1,8 +1,26 @@
-/*
- * File: MediainfoReader.cc
- * Author: django
- *
- * Created on 30. Juli 2012, 15:03
+/**
+ * ======================== legal notice ======================
+ *
+ * File: MediainfoReader.cc
+ * Created: 30. Juli 2012, 15:03
+ * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
+ * Project: libMediaScan: mediatypes and media scanning
+ *
+ * CMP - compound media player
+ *
+ * is a client/server mediaplayer intended to play any media from any workstation
+ * without the need to export or mount shares. cmps is an easy to use backend
+ * with a (ready to use) HTML-interface. Additionally the backend supports
+ * authentication via HTTP-digest authorization.
+ * cmpc is a client with vdr-like osd-menues.
+ *
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
+ * published under Creative Commons by-sa
+ * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ *
+ * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ *
+ * --------------------------------------------------------------
*/
#include <MediainfoReader.h>
#include <LineReader.h>
@@ -10,6 +28,10 @@
#include <pcrecpp.h>
#include <vector>
+static pcrecpp::RE comment("^\\s*#.*$");
+static pcrecpp::RE emptyLine("^\\s*$");
+static pcrecpp::RE entry("^\\s*(.+?)\\s*:\\s*(.+?)\\s*$");
+
cMediainfoReader::cMediainfoReader(cLineReader *LineReader)
: reader(LineReader)
{
@@ -46,24 +68,18 @@ cMediainfoReader::InfoEntry *cMediainfoReader::ReadEntry()
{
if (!reader) return NULL;
const char *line = reader->ReadLine();
- static pcrecpp::RE comment("^\\s*#.*$");
- static pcrecpp::RE emptyLine("^\\s*$");
- static pcrecpp::RE entry("^\\s*(.+?)\\s*:\\s*(.+?)\\s*$");
std::string name, value;
InfoEntry *rv = NULL;
- while (line && (comment.FullMatch(line) || emptyLine.FullMatch(line)))
- line = reader->ReadLine();
- while (line && !entry.FullMatch(line, &name, &value))
- line = reader->ReadLine();
- while (line && entry.FullMatch(line, &name, &value)) {
- if (!IsValuable(name)) {
- line = reader->ReadLine();
- continue;
+ do {
+ if (line && entry.FullMatch(line, &name, &value)) {
+ if (IsValuable(name)) {
+ rv = new InfoEntry(name, value);
+ break;
}
- rv = new InfoEntry(name, value);
- break;
}
+ line = reader->ReadLine();
+ } while (line && !rv);
return rv;
}
diff --git a/libs/mediaScan/src/Movie.cc b/libs/mediaScan/src/Movie.cc
index a63ff19..042b397 100644
--- a/libs/mediaScan/src/Movie.cc
+++ b/libs/mediaScan/src/Movie.cc
@@ -4,7 +4,7 @@
* File: Movie.cc
* Created: 2. Juli 2012, 15
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/Picture.cc b/libs/mediaScan/src/Picture.cc
index 19a02a1..5253a78 100644
--- a/libs/mediaScan/src/Picture.cc
+++ b/libs/mediaScan/src/Picture.cc
@@ -4,7 +4,7 @@
* File: Picture.cc
* Created: 2. Juli 2012, 15
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*
diff --git a/libs/mediaScan/src/VdrRecording.cc b/libs/mediaScan/src/VdrRecording.cc
index 03abccf..10b6476 100644
--- a/libs/mediaScan/src/VdrRecording.cc
+++ b/libs/mediaScan/src/VdrRecording.cc
@@ -4,7 +4,7 @@
* File: VdrRecording.cc
* Created: 3. Juli 2012, 08
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
- * Project: libfsScan: mediatypes and filesystem scanning
+ * Project: libMediaScan: mediatypes and media scanning
*
* CMP - compound media player
*