Skip to content

Commit

Permalink
Don't store the last used DVD device
Browse files Browse the repository at this point in the history
This prevents users with multiple drives from using the second one at
a later time. There's no good reason to force the use of only one drive.
  • Loading branch information
stuartm committed Jul 15, 2012
1 parent 220809a commit 49a7f31
Showing 1 changed file with 3 additions and 38 deletions.
41 changes: 3 additions & 38 deletions mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -662,8 +662,6 @@ static void jumpScreenVideoTree() { RunVideoScreen(VideoDialog::DLG_TREE, tru
static void jumpScreenVideoGallery() { RunVideoScreen(VideoDialog::DLG_GALLERY, true); }
static void jumpScreenVideoDefault() { RunVideoScreen(VideoDialog::DLG_DEFAULT, true); }

QString gDVDdevice;

static void playDisc()
{
//
Expand Down Expand Up @@ -694,10 +692,7 @@ static void playDisc()
}
else
{
QString dvd_device = gDVDdevice;

if (dvd_device.isEmpty())
dvd_device = MediaMonitor::defaultDVDdevice();
QString dvd_device = MediaMonitor::defaultDVDdevice();

if (dvd_device.isEmpty())
return; // User cancelled in the Popup
Expand Down Expand Up @@ -759,39 +754,9 @@ static void handleDVDMedia(MythMediaDevice *dvd)
if (!dvd)
return;

QString newDevice = dvd->getDevicePath();

// Device insertion. Store it for later use
if (dvd->isUsable())
if (gDVDdevice.length() && gDVDdevice != newDevice)
{
// Multiple DVD devices. Clear the old one so the user has to
// select a disk to play (in MediaMonitor::defaultDVDdevice())

LOG(VB_MEDIA, LOG_INFO,
"MythVideo: Multiple DVD drives? Forgetting " + gDVDdevice);
gDVDdevice.clear();
}
else
{
gDVDdevice = newDevice;
LOG(VB_MEDIA, LOG_INFO,
"MythVideo: Storing DVD device " + gDVDdevice);
}
else
{
// Ejected/unmounted/error.

if (gDVDdevice.length() && gDVDdevice == newDevice)
{
LOG(VB_MEDIA, LOG_INFO,
"MythVideo: Forgetting existing DVD " + gDVDdevice);
gDVDdevice.clear();
}

if (!dvd->isUsable()) // This isn't infallible, on some drives both a mount and libudf fail
return;
}


switch (gCoreContext->GetNumSetting("DVDOnInsertDVD", 1))
{
case 0 : // Do nothing
Expand Down

0 comments on commit 49a7f31

Please sign in to comment.