[mythtv] [PATCH] Detect SVCD in MediaManager

Matt Porter mporter at kernel.crashing.org
Sun Jun 27 11:35:17 EDT 2004


On Sun, Jun 27, 2004 at 07:30:19AM -0400, J. Donavan Stanley wrote:
> Matt Porter wrote:
> 
> >This patch allows the media manager to detect a SVCD that has a
> >/svcd rather than /vcd directory path. Please comment or commit.
> 
> Please resubmit this as an attachment.

Ugh, kernel patch habit...patch is attached.

-Matt
-------------- next part --------------
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