Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3073 closed defect (fixed)

MediaMonitor has problems if disk already mounted

Reported by: Nigel Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: 0.20
Severity: low Keywords:
Cc: Ticket locked: no

Description

On Linux using 0.20-fixes, if a DVD is already mounted before the frontend starts, the wrong plugin is selected (MythGallery - the default for data disks). Output reveals:

2007-02-10 02:47:34.328 Starting media monitor.
2007-02-10 02:47:34.617 Executing '/usr/bin/pmount /dev/cdrom'
mount: /dev/cdrom already mounted or /cdrom busy
mount: according to mtab, /dev/hdd is already mounted on /cdrom
2007-02-10 02:47:34.737 Failed to mount /dev/cdrom.
2007-02-10 02:47:34.739 Media status changed...  New status is: MEDIASTAT_MOUNTED old status was MEDIASTAT_NOTMOUNTED

that the mount failure is the problem. Output for later insertion of a DVD:

2007-02-10 02:30:50.613 Starting media monitor.
2007-02-10 02:30:54.298 Executing '/usr/bin/pmount /dev/cdrom'
2007-02-10 02:30:56.531 Looking for: '/cdrom/VIDEO_TS'
2007-02-10 02:30:56.540 Probable DVD detected.
2007-02-10 02:30:56.557 Executing '/usr/bin/pumount /dev/cdrom'
2007-02-10 02:30:56.798 Looking for: '/cdrom/vcd'
2007-02-10 02:30:56.808 Looking for: '/cdrom/svcd'
2007-02-10 02:30:56.829 m_MediaType: 16
2007-02-10 02:30:56.840 Media status changed...  New status is: MEDIASTAT_USEABLE old status was MEDIASTAT_NOTMOUNTED

This is not a big problem, but should be easy to fix?

Change History (4)

comment:1 Changed 17 years ago by Nigel

Status: newassigned

This seems to do the trick:

Index: mythcdrom-linux.cpp
===================================================================
--- mythcdrom-linux.cpp (revision 12770)
+++ mythcdrom-linux.cpp (working copy)
@@ -143,10 +143,12 @@
                                       .arg(this->m_VolumeID)
                                       .arg(QString(buf.creation_date).left(16));
 
-                        // attempt to mount the disc
                         // the base class's onDeviceMounted will do fine
                         // grained detection of the type of data on this disc
-                        mount();
+                        if (isMounted(true))
+                            onDeviceMounted();
+                        else
+                            mount();  // onDeviceMounted() called as side-effect
 
                         if (isMounted(true))
                         {

comment:2 Changed 17 years ago by Nigel

(In [12788]) Trying to mount() already mounted CD was breaking detection logic. See #3073

comment:3 Changed 17 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [12790]) Minor CD volume detection and double-eject fixes. See #2462. Closes #3073.

comment:4 Changed 17 years ago by Nigel

(In [12812]) Prevent double mount attempt. See #3073

Note: See TracTickets for help on using tickets.