[mythtv] Mythfrontend hang with CVS

Stacey Son mythdev at son.org
Tue Jun 8 17:53:46 EDT 2004


Leo Weppelman wrote:

>The next patch fixes the crash, unfortunately, the media monitor does
>not work yet. It doesn't seem to sense mediachanges - and it _did_
>2 weeks ago :-/
>
>Leo
>
>  
>
I think there may be a problem with the class inheritance or something 
here...

MythCDROMLinux::unlock() should be calling MythCDROM::openDevice() and 
the first thing that it should do is call MythMediaDevice::openDevice() 
which checks to is if the device is already open:

bool MythMediaDevice::openDevice()
{
    // Sanity check
    if (isDeviceOpen())
        return true;

Just to rule out any other problems try running the following and change 
CDs while it is running:

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/ioctl.h>
#include <linux/cdrom.h>

int main(void) {
    int cd = open("/dev/cdrom", O_RDONLY|O_NONBLOCK);
    while(1) {

        printf ("media changed[%d]\n", ioctl(cd, CDROM_MEDIA_CHANGED, 
CDSL_CURRENT));

        switch (ioctl(cd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) {
            case CDS_DISC_OK: printf("DISK_OK\n"); break;
            case CDS_TRAY_OPEN: printf("TRAY_OPEN\n"); break;
            case CDS_DRIVE_NOT_READY: printf("DRIVE_NOT_READY\n"); break;
            default: printf("default\n"); break;
        }

        sleep(2);
    }
}



More information about the mythtv-dev mailing list