Index: mythdvd/mtd/jobthread.cpp
===================================================================
--- mythdvd/mtd/jobthread.cpp	(revision 8986)
+++ mythdvd/mtd/jobthread.cpp	(working copy)
@@ -46,7 +46,8 @@
 
 void JobThread::run()
 {
-    cerr << "jobthread.o: Somebody ran an actual (base class) JobThread. I don't think that's supposed to happen." << endl;
+    VERBOSE(VB_IMPORTANT, "Somebody ran an actual (base class) JobThread. I"
+            " don't think that's supposed to happen.");
 }
 
 bool JobThread::keepGoing()
@@ -217,8 +218,9 @@
         {
             if (!(m_mutex && m_mutex->locked()))
             {
-                cerr << __FILE__ << ": Invalid mutext passed to MutexUnlocker"
-                        << endl;
+                VERBOSE(VB_IMPORTANT,
+                        QString("%1: Invalid mutext passed to MutexUnlocker")
+                        .arg(__FILE__));
             }
         }
 
@@ -284,7 +286,8 @@
 
 void DVDThread::run()
 {
-    cerr << "jobthread.o: Somebody ran an actual (base class) DVDThread. I don't think that's supposed to happen." << endl;
+    VERBOSE(VB_IMPORTANT, "Somebody ran an actual (base class) DVDThread. I"
+            " don't think that's supposed to happen.");
 }
 
 
@@ -476,7 +479,8 @@
                                     &video_data[0]);
             if( len != 1)
             {
-                problem(QString("DVDPerfectThread read failed for block %1").arg(cur_pack));
+                problem(QString("DVDPerfectThread read failed for block %1")
+                        .arg(cur_pack));
                 return false;
             }
             
Index: mythdvd/mtd/dvdprobe.cpp
===================================================================
--- mythdvd/mtd/dvdprobe.cpp	(revision 8986)
+++ mythdvd/mtd/dvdprobe.cpp	(working copy)
@@ -289,7 +289,9 @@
     else
     {
         fr_code = 0;
-        cerr << "dvdprobe.o: Could not find a frame rate code given a frame rate of " << fr << endl ;
+        VERBOSE(VB_IMPORTANT,
+                QString("dvdprobe.o: Could not find a frame rate code given a"
+                        " frame rate of %1").arg(fr));
     }
     
     
@@ -401,23 +403,24 @@
     }
     else
     {
-        cerr << "dvdprobe.o: You have a title on your dvd in a format myth doesn't understand." << endl;
-        cerr << "dvdprobe.o: Either that, or you haven't installed the dvdinput table." << endl;
-        cerr << "dvdprobe.o: You probably want to report this to a mailing list or something: " << endl;
-        cerr << "                  height = " << hsize << endl;
-        cerr << "                   width = " << vsize << endl;
-        cerr << "            aspect ratio = " << aspect_ratio << " (" << ar_numerator << "/"<< ar_denominator << ")" << endl;
-        cerr << "              frame rate = " << frame_rate << endl;
-        cerr << "                 fr_code = " << fr_code << endl;
-        if(letterbox)
-        {
-            cerr << "             letterboxed = true " << endl;
-        }
-        else
-        {
-            cerr << "             letterboxed = false " << endl;
-        }
-        cerr << "                  format = " << video_format << endl;
+        QString msg =
+                QString("You have a title on your dvd in a format myth doesn't"
+                    " understand.\n"
+                    "Either that, or you haven't installed the dvdinput"
+                    " table.\n"
+                    "You probably want to report this to a mailing list or"
+                    " something:\n"
+                    "                  height = %1\n"
+                    "                   width = %2\n"
+                    "            aspect ratio = %3 (%4/%5)\n"
+                    "              frame rate = %6\n"
+                    "                 fr_code = %7\n"
+                    "             letterboxed = %8\n"
+                    "                  format = %9")
+                .arg(hsize).arg(vsize)
+                .arg(aspect_ratio).arg(ar_numerator).arg(ar_denominator)
+                .arg(frame_rate).arg(fr_code).arg(letterbox).arg(video_format);
+        VERBOSE(VB_IMPORTANT, msg);
     }    
 }
 
@@ -442,13 +445,12 @@
     device = dvd_device;
     dvd = NULL;
     titles.setAutoDelete(true);
-    titles.clear();
-    volume_name = QObject::tr("Unknown");
-    first_time = true;
+    wipeClean();
 }
 
 void DVDProbe::wipeClean()
 {
+    first_time = true;
     titles.clear();
     volume_name = QObject::tr("Unknown");
 }
@@ -481,7 +483,22 @@
     //
 
     int drive_handle = open(device, O_RDONLY | O_NONBLOCK);
-    int status = ioctl(drive_handle, CDROM_DRIVE_STATUS, NULL);
+
+    if (drive_handle == -1)
+    {
+        wipeClean();
+        return false;
+    }
+
+    // Sometimes the first result following an open is a lie. Often the
+    // first call will return 4, however an immediate second call will
+    // return 2. Anecdotally the first result after an open has only
+    // a 1 in 8 chance of detecting changes from 4 to 2, while a second call
+    // (in an admittedly small test number) seems to make it much more
+    // accurate (with only a 1 in 6 chance that the first result was more
+    // accurate than the second).
+    ioctl(drive_handle, CDROM_DRIVE_STATUS, CDSL_CURRENT);
+    int status = ioctl(drive_handle, CDROM_DRIVE_STATUS, CDSL_CURRENT);
     if(status < 4)
     {
         //
@@ -529,8 +546,8 @@
     //  could be a path, file, whatever).
     //
     
+    wipeClean();
     first_time = false;
-    wipeClean();
     dvd = DVDOpen(device);
     if(dvd)
     {
@@ -548,7 +565,8 @@
         }
         else
         {
-            cerr << "dvdprobe.o: Error getting volume name, setting to \"Unknown\"" << endl;
+            VERBOSE(VB_IMPORTANT, "Error getting volume name, setting to"
+                    "\"Unknown\"");
         }
         
         ifo_handle_t *ifo_file = ifoOpen(dvd, 0);
@@ -574,7 +592,9 @@
                 video_transport_file = ifoOpen(dvd, title_info->title[i].title_set_nr);
                 if(!video_transport_file)
                 {
-                    cerr << "dvdprobe.o: Can't get video transport for track " << i+1 << endl;
+                    VERBOSE(VB_IMPORTANT,
+                            QString("Can't get video transport for track %1")
+                            .arg(i+1));
                 }
                 else
                 {
@@ -603,7 +623,9 @@
                             framerate = 24000/1001.0;  // NTSC_FILM
                             break;
                         default:
-                            cerr << "dvdprobe.o: For some odd reason (!), I couldn't get a video frame rate" << endl;
+                            VERBOSE(VB_IMPORTANT,
+                                    "For some odd reason (!), I couldn't get a"
+                                    " video frame rate");
                             break;
                     }
                     
@@ -688,7 +710,8 @@
                                 new_title->setAR(16, 9, "16:9");
                                 break;
                             default:
-                                cerr << "dvdprobe.o: couldn't get aspect ratio for a title" << endl;
+                                VERBOSE(VB_IMPORTANT, "couldn't get aspect"
+                                        " ratio for a title");
                         }
                         
                         switch(video_attributes->video_format)
@@ -700,7 +723,8 @@
                                 new_title->setVFormat("pal");
                                 break;
                             default:
-                                cerr << "dvdprobe.o: Could not get video format for a title" << endl;
+                                VERBOSE(VB_IMPORTANT, "Could not get video"
+                                        " format for a title");
                         }
                         
                         if(video_attributes->letterboxed)
@@ -728,13 +752,16 @@
                                 new_title->setSize(352, c_height / 2);
                                 break;
                             default:
-                                cerr << "dvdprobe.o: Could not determine for video size for a title." << endl ;
+                                VERBOSE(VB_IMPORTANT, "Could not determine for"
+                                        " video size for a title.");
                         }
                         ifoClose(video_transport_file);
                     }
                     else
                     {
-                        cerr << "Couldn't find any audio or video information for track " << i+1 << endl;
+                        VERBOSE(VB_IMPORTANT,
+                                QString("Couldn't find any audio or video"
+                                        " information for track %1").arg(i+1));
                     }            
                 }
                 
@@ -803,4 +830,3 @@
     }
     wipeClean();
 }
-
Index: mythdvd/mtd/fileobs.cpp
===================================================================
--- mythdvd/mtd/fileobs.cpp	(revision 8986)
+++ mythdvd/mtd/fileobs.cpp	(working copy)
@@ -59,9 +59,12 @@
         QDir stupid_qdir("this_is_stupid");
         if(!stupid_qdir.rename(active_file->name(), new_name))
         {
-            cerr << "fileobs.o: Couldn't rename a ripped file on close ... that sucks." << endl;
-            cerr << "   old name: \"" << active_file->name() << "\"" << endl;
-            cerr << "   new name: \"" << new_name << "\"" << endl;
+            VERBOSE(VB_IMPORTANT,
+                    QString("Couldn't rename a ripped file on close ... "
+                            " that sucks.\n"
+                            "   old name: \"%1\"\n"
+                            "   new name: \"%1\"")
+                    .arg(active_file->name()).arg(new_name));
         }
         else
         {
@@ -74,10 +77,12 @@
         QFile *iter;
         for(iter = files.first(); iter; iter = files.next())
         {
-            QString new_name = iter->name() + QString("%1").arg(files.count()) + extension;
+            QString new_name = iter->name() + QString("%1").arg(files.count()) +
+                    extension;
             if(!stupid_qdir.rename(iter->name(), new_name))
             {
-                cerr << "fileobs.o: Couldn't rename \"" << iter->name() << "\" to \"" << new_name << "\"" << endl;
+                VERBOSE(VB_IMPORTANT, QString("Couldn't rename '%1' to '%2'")
+                        .arg(iter->name()).arg(new_name));
             }
             else
             {
@@ -124,7 +129,8 @@
         files.append(new_file);
         if(!active_file->open(access_mode))
         {
-            cerr << "fileobs.o: couldn't open another file in a set of rip files." << endl;
+            VERBOSE(VB_IMPORTANT,
+                    "couldn't open another file in a set of rip files.");
             return false;               
         }
         bytes_written = 0;
@@ -132,24 +138,29 @@
     int result = write(active_file->handle(), the_data, how_much);
     if(result < 0)
     {
-        cerr << "fileobs.o: Got a negative result while writing blocks. World may end shortly." << endl;
+        VERBOSE(VB_IMPORTANT, "Got a negative result while writing blocks."
+                " World may end shortly.");
         return false;
     }
     if(result == 0)
     {
         if(how_much == 0)
         {
-            cerr << "fileobs.o: Ripfile wrote 0 bytes, but that's all it was asked to. Unlikely coincidence?" << endl;
+            VERBOSE(VB_IMPORTANT, "Ripfile wrote 0 bytes, but that's all it"
+                    " was asked to. Unlikely coincidence?");
         }
         else
         {
-            cerr << "fileobs.o: Ripfile writing 0 bytes of data. That's probably not a good sign." << endl;
+            VERBOSE(VB_IMPORTANT, "Ripfile writing 0 bytes of data. That's"
+                    " probably not a good sign.");
             return false;
         }
     }
     if(result != how_much)
     {
-        cerr << "fileobs.o: Ripfile tried to write " << how_much << " bytes, but only managed to write " << result << endl ;
+        VERBOSE(VB_IMPORTANT, QString("Ripfile tried to write %1 bytes, but"
+                                      " only managed to write %2")
+                                      .arg(how_much).arg(result));
         return false;
     }
     bytes_written += result;
Index: mythdvd/mtd/main.cpp
===================================================================
--- mythdvd/mtd/main.cpp	(revision 8986)
+++ mythdvd/mtd/main.cpp	(working copy)
@@ -70,6 +70,21 @@
                 return FRONTEND_EXIT_INVALID_CMDLINE;
             }
         }
+        else if (!strcmp(a.argv()[argpos],"-v"))
+        {
+            if (++argpos >= argc) {
+                cerr << "Error: -v requires parameters (try -v help)" <<
+                        std::endl;
+                return GENERIC_EXIT_INVALID_CMDLINE;
+            }
+
+            int err;
+            if ((err = parse_verbose_arg(a.argv()[argpos])) !=
+                GENERIC_EXIT_OK)
+            {
+                return err;
+            }
+        }
         else
         {
             cerr << "Invalid argument: " << a.argv()[argpos] << endl <<
Index: mythdvd/mtd/logging.cpp
===================================================================
--- mythdvd/mtd/logging.cpp	(revision 8986)
+++ mythdvd/mtd/logging.cpp	(working copy)
@@ -25,7 +25,8 @@
     QString logfile_name = gContext->GetSetting("DVDRipLocation");
     if(logfile_name.length() < 1)
     {
-        cerr << "MTDLogger.o: You do not have a DVD rip directory set. Run Setup." << endl;
+        VERBOSE(VB_IMPORTANT, "You do not have a DVD rip directory set."
+                  " Run Setup.");
         exit(0);
     }    
     logfile_name.append("/mtd.log");
@@ -34,7 +35,9 @@
         logging_file.setName(logfile_name);
         if(!logging_file.open(IO_WriteOnly))
         {
-            cerr << "MTDLogger.o: Problem opening logfile. Does this look openable to you: " << logfile_name << endl;
+            VERBOSE(VB_IMPORTANT, QString("Problem opening logfile. Does this"
+                                          "look openable to you: %1")
+                                          .arg(logfile_name));
             exit(0);
         }
     }
Index: configure
===================================================================
--- configure	(revision 8986)
+++ configure	(working copy)
@@ -347,7 +347,7 @@
     fi
 fi
 
-# vcd support detection rutine does here
+# vcd support detection routine does here
 
 if test "$exif" != "no" ; then
     exif="no"
