[mythtv] [PATCH] Detect SVCD in MediaManager
Matt Porter
mporter at kernel.crashing.org
Sat Jun 26 23:12:30 EDT 2004
This patch allows the media manager to detect a SVCD that has a
/svcd rather than /vcd directory path. Please comment or commit.
-Matt
Index: libs/libmyth/mythcdrom.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythcdrom.cpp,v
retrieving revision 1.7
diff -u -r1.7 mythcdrom.cpp
--- libs/libmyth/mythcdrom.cpp 4 Jun 2004 02:31:22 -0000 1.7
+++ libs/libmyth/mythcdrom.cpp 27 Jun 2004 03:05:16 -0000
@@ -21,6 +21,10 @@
#define PATHTO_VCD_DETECT "/vcd"
#endif
+#ifndef PATHTO_SVCD_DETECT
+#define PATHTO_SVCD_DETECT "/svcd"
+#endif
+
MythCDROM* MythCDROM::get(QObject* par, const char* devicePath, bool SuperMount,
bool AllowEject) {
#ifdef linux
@@ -54,7 +58,7 @@
void MythCDROM::onDeviceMounted()
{
- QString DetectPath;
+ QString DetectPath, DetectPath2;
DetectPath.sprintf("%s%s", (const char*)m_MountPath, PATHTO_DVD_DETECT);
VERBOSE(VB_ALL, QString("Looking for: '%1'").arg(DetectPath));
@@ -71,11 +75,14 @@
DetectPath.sprintf("%s%s", (const char*)m_MountPath, PATHTO_VCD_DETECT);
VERBOSE(VB_ALL, QString("Looking for: '%1'").arg(DetectPath));
- if (stat(DetectPath, &sbuf) == 0)
+ DetectPath2.sprintf("%s%s", (const char*)m_MountPath, PATHTO_SVCD_DETECT);
+ VERBOSE(VB_ALL, QString("Looking for: '%1'").arg(DetectPath2));
+
+ if (stat(DetectPath, &sbuf) == 0 || stat(DetectPath2, &sbuf) == 0)
{
- VERBOSE(VB_GENERAL, "Probable VCD detected.");
+ VERBOSE(VB_GENERAL, "Probable VCD/SVCD detected.");
m_MediaType = MEDIATYPE_VCD;
- // HACK make it possible to eject a VCD by unmounting it
+ // HACK make it possible to eject a VCD/SVCD by unmounting it
performMountCmd(false);
m_Status = MEDIASTAT_USEABLE;
}
More information about the mythtv-dev
mailing list