summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c31
-rw-r--r--config.h3
2 files changed, 31 insertions, 3 deletions
diff --git a/config.c b/config.c
index 1c518f0c..02556cb5 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.81 2009-05-31 15:07:10 phintuka Exp $
+ * $Id: config.c,v 1.82 2009-05-31 15:30:07 phintuka Exp $
*
*/
@@ -399,7 +399,34 @@ bool config_t::IsImageFile(const char *fname)
bool config_t::IsDvdImage(const char *fname)
{
const char *ext = get_extension(fname);
- return (ext && !strcasecmp(ext, ".iso")) ? true : false;
+ return (ext && !strcasecmp(ext, "iso")) ? true : false;
+}
+
+bool config_t::IsDvdFolder(const char *fname)
+{
+ struct stat st;
+ cString buf, folder;
+
+ buf = cString::sprintf("%s/VIDEO_TS/", fname);
+ if (stat(buf, &st) == 0) {
+ folder = buf;
+ } else {
+ buf = cString::sprintf("%s/video_ts/", fname);
+ if (stat(buf, &st) == 0)
+ folder = buf;
+ else
+ return false;
+ }
+
+ buf = cString::sprintf("%s/video_ts.ifo", *folder);
+ if (stat(buf, &st) == 0)
+ return true;
+
+ buf = cString::sprintf("%s/VIDEO_TS.IFO", *folder);
+ if (stat(buf, &st) == 0)
+ return true;
+
+ return false;
}
cString config_t::AutocropOptions(void)
diff --git a/config.h b/config.h
index c59e09ec..86ce315d 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.60 2009-05-31 15:07:10 phintuka Exp $
+ * $Id: config.h,v 1.61 2009-05-31 15:30:07 phintuka Exp $
*
*/
@@ -397,6 +397,7 @@ class config_t {
bool IsAudioFile(const char *);
bool IsVideoFile(const char *);
bool IsPlaylistFile(const char *);
+ bool IsDvdFolder(const char *);
bool IsDvdImage(const char *);
cString AutocropOptions(void);