summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-07-10 21:35:22 +0000
committerphintuka <phintuka>2011-07-10 21:35:22 +0000
commit6225ec84de16738b9b4a154a6737ee45962f33d5 (patch)
treed5c5bcbea493082a7f9c7ae9f5937019c6fe92de
parente82321147e89dff667e552afb58cc18318ee693a (diff)
downloadxineliboutput-6225ec84de16738b9b4a154a6737ee45962f33d5.tar.gz
xineliboutput-6225ec84de16738b9b4a154a6737ee45962f33d5.tar.bz2
Assume .iso images larger than 10G are BluRay images
-rw-r--r--config.c13
-rw-r--r--config.h3
-rw-r--r--menu.c10
3 files changed, 23 insertions, 3 deletions
diff --git a/config.c b/config.c
index 0db72481..44ba8b69 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.104 2011-07-10 17:46:52 phintuka Exp $
+ * $Id: config.c,v 1.105 2011-07-10 21:35:22 phintuka Exp $
*
*/
@@ -421,6 +421,17 @@ bool config_t::IsDvdImage(const char *fname)
return (ext && !strcasecmp(ext, "iso")) ? true : false;
}
+bool config_t::IsBluRayImage(const char *fname)
+{
+ if (IsDvdImage(fname)) {
+ struct stat st;
+ if (!stat(fname, &st)) {
+ return st.st_size > 10*1024*1024*1024ll;
+ }
+ }
+ return false;
+}
+
bool config_t::IsDvdFolder(const char *fname)
{
struct stat st;
diff --git a/config.h b/config.h
index fc1be050..903e5ef2 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.80 2011-07-10 17:57:14 phintuka Exp $
+ * $Id: config.h,v 1.81 2011-07-10 21:35:22 phintuka Exp $
*
*/
@@ -453,6 +453,7 @@ class config_t {
static bool IsDvdFolder(const char *);
static bool IsBluRayFolder(const char *);
static bool IsDvdImage(const char *);
+ static bool IsBluRayImage(const char *);
cString AutocropOptions(void);
cString SwScaleOptions(void);
diff --git a/menu.c b/menu.c
index 77e8528b..7efc38e2 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c,v 1.87 2011-06-14 21:56:17 phintuka Exp $
+ * $Id: menu.c,v 1.88 2011-07-10 21:35:22 phintuka Exp $
*
*/
@@ -408,6 +408,10 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Queue, bool Rewind)
if (Rewind)
unlink(cString::sprintf("%s.resume", *f));
+ if (GetCurrent()->IsBluRay()) {
+ AddSubMenu(new cMenuBluray(f));
+ return osContinue;
+ }
if (GetCurrent()->IsDvd())
cPlayerFactory::Launch(pmAudioVideo, cPlaylist::BuildMrl("dvd", f), NULL, true);
else
@@ -480,6 +484,10 @@ bool cMenuBrowseFiles::ScanDir(const char *DirName)
} else if (m_Mode == ShowImages && xc.IsImageFile(buffer)) {
Add(new cFileListItem(e->d_name, false));
+ // BluRay image (.iso)
+ } else if (m_Mode == ShowFiles && xc.IsBluRayImage(buffer)) {
+ Add(new cFileListItem(e->d_name, false, false, NULL, false, true));
+
// DVD image (.iso)
} else if (m_Mode == ShowFiles && xc.IsDvdImage(buffer)) {
Add(new cFileListItem(e->d_name, false, false, NULL, true));