Index: mythplugins/configure
===================================================================
--- mythplugins/configure	(revision 27285)
+++ mythplugins/configure	(working copy)
@@ -234,6 +234,8 @@
 for opt do
   optval="${opt#*=}"
   case "$opt" in
+  --targetos=*) targetos=`echo $opt | cut -d '=' -f 2`
+  ;;
   --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
   ;;
   --libdir-name=*) libdir_name=`echo $opt | cut -d '=' -f 2`;
@@ -315,7 +317,7 @@
         done
     fi
 
-    LIBPATHS="`echo $LIBPATHS $sysroot$prefix/$libdir_name $sysroot/$libdir_name $sysroot/usr/$libdir_name $sysroot/usr/local/$libdir_name $sysroot/usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` "
+    LIBPATHS="`echo $LIBPATHS $prefix/$libdir_name $sysroot/$libdir_name $sysroot/usr/$libdir_name $sysroot/usr/local/$libdir_name $sysroot/usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` "
 
     HAS_IT="no"
     for LIBPATH in $LIBPATHS ; do
@@ -328,7 +330,7 @@
 
 has_header()
 {
-    HPATHS="$sysroot$prefix/include $sysroot/usr/local/include $sysroot/usr/include $sysroot/usr/include/g++-v3 $sysroot/usr/X11R6/include $sysroot/"
+    HPATHS="$prefix/include $sysroot/usr/local/include $sysroot/usr/include $sysroot/usr/include/g++-v3 $sysroot/usr/X11R6/include $sysroot/"
     INCL=`echo $DYLD_LIBRARY_PATH $LD_LIBRARY_PATH | sed s/':'/' '/g`
     HPATHS="$HPATHS `echo $INCL | sed s/$libdir_name/include/g` "
 
@@ -552,7 +554,7 @@
 
     if test "$vorbis" = "no" -o "$flac" = "no" -o "$mp3lame" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then
         echo "Disabling MythMusic due to missing dependencies."
-        music="no"
+        #music="no"
     fi
 fi
 
@@ -585,13 +587,13 @@
 ###########################################################
 
 # bring in mythtv config
-if [ -e $sysroot$prefix/include/mythtv/mythconfig.mak ] ; then
+if [ -e $prefix/include/mythtv/mythconfig.mak ] ; then
   rm mythconfig.mak 2> /dev/null
-  ln -s $sysroot$prefix/include/mythtv/mythconfig.mak mythconfig.mak
+  ln -s $prefix/include/mythtv/mythconfig.mak mythconfig.mak
 else
-  echo "ERROR: mythconfig.mak not found at $sysroot$prefix/include/mythtv/mythconfig.mak"
+  echo "ERROR: mythconfig.mak not found at $prefix/include/mythtv/mythconfig.mak"
   echo "Did you make AND install MythTV first?"
-  echo "Are you using the correct prefix ($prefix) and sysroot ($sysroot)?"
+  echo "Are you using the correct prefix ($prefix)?"
   echo "Bailing out!!"
   exit
 fi
Index: mythplugins/mythmusic/mythmusic/playbackbox.cpp
===================================================================
--- mythplugins/mythmusic/mythmusic/playbackbox.cpp	(revision 27285)
+++ mythplugins/mythmusic/mythmusic/playbackbox.cpp	(working copy)
@@ -468,7 +468,8 @@
                                             160, 160);
                 mainvisual->setVisual(visual_modes[current_visual]);
                 bannerDisable();
-                updateTrackInfo(curMeta);
+                if (curMeta)
+                    updateTrackInfo(curMeta);
 
                 if (!m_parent->IsExitingToMain())
                     handled = true;
@@ -970,7 +971,7 @@
 
 void PlaybackBoxMusic::occasionallyCheckCD()
 {
-    if (!cd_reader_thread->getLock()->tryLock())
+    if (!cd_reader_thread || !cd_reader_thread->getLock()->tryLock())
         return;
     cd_reader_thread->getLock()->unlock();
 
@@ -1068,7 +1069,8 @@
 
         GenericTree *node = music_tree_list->getCurrentNode();
         curMeta = gMusicData->all_music->getMetadata(node->getInt());
-        updateTrackInfo(curMeta);
+        if (curMeta)
+            updateTrackInfo(curMeta);
 
         setShuffleMode(gPlayer->getShuffleMode());
 
@@ -1106,6 +1108,9 @@
                 if (scan_for_cd)
                     updatePlaylistFromCD();
 
+                bool bLocked = cd_reader_thread ?
+                    cd_reader_thread->getLock()->lock(), true : false;
+
                 music_tree_list->showWholeTree(show_whole_tree);
                 Q3ValueList <int> branches_to_current_node;
                 branches_to_current_node.append(0); //  Root node
@@ -1135,6 +1140,8 @@
                 if (curMeta)
                     updateTrackInfo(curMeta);
 
+                if (bLocked && cd_reader_thread)
+                    cd_reader_thread->getLock()->unlock();
                 return;     // Do not restart Timer
             }
             else
@@ -1357,7 +1364,8 @@
             gPlayer->getOutput()->SetTimecode(0);
     }
 
-    bannerEnable(curMeta, show_album_art);
+    if (curMeta)
+        bannerEnable(curMeta, show_album_art);
 }
 
 void PlaybackBoxMusic::visEnable()
@@ -1388,7 +1396,7 @@
 {
     if (mainvisual->bannerIsShowing())
         bannerDisable();
-    else
+    else if (mdata)
         bannerEnable(mdata, false);
 }
 
@@ -1801,7 +1809,8 @@
                         if (node)
                         {
                             curMeta = gMusicData->all_music->getMetadata(node->getInt());
-                            updateTrackInfo(curMeta);
+                            if (curMeta)
+                                updateTrackInfo(curMeta);
 
                             maxTime = curMeta->Length() / 1000;
 
@@ -1827,7 +1836,8 @@
                     if (node)
                     {
                         curMeta = gMusicData->all_music->getMetadata(node->getInt());
-                        updateTrackInfo(curMeta);
+                        if (curMeta)
+                            updateTrackInfo(curMeta);
 
                         maxTime = curMeta->Length() / 1000;
 
@@ -2069,24 +2079,27 @@
 
 void PlaybackBoxMusic::updateTrackInfo(Metadata *mdata)
 {
-    if (visualizer_status != 2)
+    if (mdata)
     {
-        if (title_text)
-            title_text->SetText(mdata->FormatTitle());
-        if (artist_text)
-            artist_text->SetText(mdata->FormatArtist());
-        if (album_text)
-            album_text->SetText(mdata->Album());
-        if (albumart_image)
-            showAlbumArtImage(mdata);
+        if (visualizer_status != 2)
+        {
+            if (title_text)
+                title_text->SetText(mdata->FormatTitle());
+            if (artist_text)
+                artist_text->SetText(mdata->FormatArtist());
+            if (album_text)
+                album_text->SetText(mdata->Album());
+            if (albumart_image)
+                showAlbumArtImage(mdata);
 
-        if (showrating)
-        {
-            if (ratings_image)
-                ratings_image->setRepeat(mdata->Rating());
+            if (showrating)
+            {
+                if (ratings_image)
+                    ratings_image->setRepeat(mdata->Rating());
+            }
         }
+        setTrackOnLCD(mdata);
     }
-    setTrackOnLCD(mdata);
 }
 
 void PlaybackBoxMusic::showAlbumArtImage(Metadata *mdata)
@@ -2164,9 +2177,9 @@
         }
 
         curMeta = gMusicData->all_music->getMetadata(node_int);
+        if (curMeta)
+            updateTrackInfo(curMeta);
 
-        updateTrackInfo(curMeta);
-
         maxTime = curMeta->Length() / 1000;
 
         QString time_string = getTimeString(maxTime, 0);
Index: mythplugins/mythmusic/mythmusic/decoderhandler.cpp
===================================================================
--- mythplugins/mythmusic/mythmusic/decoderhandler.cpp	(revision 27285)
+++ mythplugins/mythmusic/mythmusic/decoderhandler.cpp	(working copy)
@@ -266,11 +266,16 @@
     m_playlist_pos = -1;
     m_redirects = 0;
 
+#if QT_VERSION >= 0x040600
+    QUrl url = QUrl::fromUserInput( mdata->Filename()); // Qt >= 4.6
+#else
     QUrl url;
-    if (mdata->Filename().startsWith('/'))
+    // NB Win32 absolute paths start d:/...
+    if (QFileInfo(mdata->Filename()).isAbsolute())
         url = QUrl::fromLocalFile(mdata->Filename());
     else
         url.setUrl(mdata->Filename());
+#endif
 
     bool result = createPlaylist(url);
     if (m_state == LOADING && result)
@@ -328,7 +333,8 @@
     PlayListFileEntry *entry = m_playlist.get(m_playlist_pos);
 
     QUrl url;
-    if (entry->File().startsWith('/'))
+    // NB Win32 absolute paths start d:/...
+    if (QFileInfo(entry->File()).isAbsolute())
         url = QUrl::fromLocalFile(entry->File());
     else
         url.setUrl(entry->File());
@@ -398,7 +404,8 @@
 
     if (extension == ".pls" || extension == ".m3u")
     {
-        if (url.scheme() == "file" || url.toString().startsWith('/'))
+        // NB Win32 absolute paths start d:/...
+        if (url.scheme() == "file" || QFileInfo(url.toString()).isAbsolute())
             return createPlaylistFromFile(url);
         else
             return createPlaylistFromRemoteUrl(url);
@@ -411,7 +418,8 @@
 {
     PlayListFileEntry *entry = new PlayListFileEntry;
 
-    if (url.scheme() == "file" || url.toString().startsWith('/'))
+    // NB Win32 absolute paths start d:/...
+    if (QFileInfo(url.toString()).isAbsolute())
         entry->setFile(url.toLocalFile());
     else
         entry->setFile(url.toString());
@@ -513,7 +521,8 @@
     if (haveIOFactory()) 
         deleteIOFactory();
 
-    if (url.scheme() == "file" || url.toString().startsWith('/') || url.toString().endsWith(".cda"))
+    // NB Win32 absolute paths start d:/...
+    if (url.scheme() == "file" || QFileInfo(url.toString()).isAbsolute() || url.toString().endsWith(".cda"))
         m_io_factory = new DecoderIOFactoryFile(this);
     else if (m_meta && m_meta->Format() == "cast")
         m_io_factory = new DecoderIOFactoryShoutCast(this);
Index: mythplugins/mythmusic/mythmusic/main.cpp
===================================================================
--- mythplugins/mythmusic/mythmusic/main.cpp	(revision 27285)
+++ mythplugins/mythmusic/mythmusic/main.cpp	(working copy)
@@ -272,6 +272,7 @@
 {
     loadMusic();
 
+#ifndef USING_MINGW
     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
 
     Ripper *rip = new Ripper(mainStack, chooseCD());
@@ -284,12 +285,14 @@
     QObject::connect(rip, SIGNAL(ripFinished()),
                      gMusicData, SLOT(reloadMusic()),
                      Qt::QueuedConnection);
+#endif
 }
 
 static void startImport(void)
 {
     loadMusic();
 
+#ifndef USING_MINGW
     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
 
     ImportMusicDialog *import = new ImportMusicDialog(mainStack);
@@ -302,6 +305,7 @@
     QObject::connect(import, SIGNAL(importFinished()),
                      gMusicData, SLOT(reloadMusic()),
                      Qt::QueuedConnection);
+#endif
 }
 
 static void MusicCallback(void *data, QString &selection)
@@ -396,6 +400,7 @@
 {
     loadMusic();
 
+#ifndef USING_MINGW
     MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
 
     Ripper *rip = new Ripper(mainStack, chooseCD());
@@ -408,6 +413,7 @@
     QObject::connect(rip, SIGNAL(ripFinished()),
                      gMusicData, SLOT(reloadMusic()),
                      Qt::QueuedConnection);
+#endif
 }
 
 static void runScan(void)
@@ -472,7 +478,15 @@
     }
 
     if (gCoreContext->GetNumSetting("AutoPlayCD", 0))
+    {
+        // Empty the playlist to ensure CD is played first
+        if (gMusicData->all_music)
+            gMusicData->all_music->clearCDData();
+        if (gMusicData->all_playlists)
+            gMusicData->all_playlists->clearCDList();
+
         runMusicPlayback();
+    }
     else
         mythplugin_run();
 }
Index: mythplugins/mythgallery/mythgallery/iconview.cpp
===================================================================
--- mythplugins/mythgallery/mythgallery/iconview.cpp	(revision 27285)
+++ mythplugins/mythgallery/mythgallery/iconview.cpp	(working copy)
@@ -42,6 +42,7 @@
 #include <mythmainwindow.h>
 #include <mythprogressdialog.h>
 #include <mythmediamonitor.h>
+#include <mythverbose.h>
 
 // MythGallery headers
 #include "galleryutil.h"
@@ -171,7 +172,7 @@
 
     if (err)
     {
-        VERBOSE(VB_IMPORTANT, "Cannot load screen 'gallery'");
+        VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot load screen 'gallery'");
         return false;
     }
 
@@ -204,6 +205,7 @@
         m_thumbGen->setSize(thumbWidth, thumbHeight);
 
     SetupMediaMonitor();
+    LoadDirectory(m_galleryDir);
 
     return true;
 }
@@ -370,7 +372,6 @@
         }
     }
     m_currDevice = NULL;
-    LoadDirectory(m_galleryDir);
 #endif // _WIN32
 }
 
@@ -492,10 +493,10 @@
                 {
                     QDir currentDir(m_currDir);
                     QDir rootDir(m_galleryDir);
-                    if (currentDir != rootDir) 
-                        HandleSubDirEscape(m_galleryDir);
-                    else 
+                    if (currentDir == rootDir) 
                         break;
+                    if ( !HandleSubDirEscape(m_galleryDir))
+                        break;
                 }
                 handled = HandleEscape();
             }
