[mythtv] Patching MythGallery to use internal video player

Matthew Wire devel at mrwire.co.uk
Sat May 27 00:37:07 UTC 2006


Hi,

I've written a patch for mythgallery to allow the internal video player
to be used.  However, when I try and view any videos all I get is a
black screen and no error messages.  This is all I get in the frontend
log:
2006-05-27 01:34:41.447 XMLParse::LoadTheme
using /usr/local/share/mythtv/themes/default/gallery-ui.xml
QDate::fromString: Parameter out of range
2006-05-27 01:34:45.884 TV: Attempting to change from None to
WatchingPreRecorded

at which point mythfrontend hangs.
Is there something else that I should have initialised or something?

Thanks,
Matthew Wire

The patch is here against latest SVN:
----PATCH BEGIN-----
Index: mythgallery/glsingleview.cpp
===================================================================
--- mythgallery/glsingleview.cpp        (revision 10024)
+++ mythgallery/glsingleview.cpp        (working copy)
@@ -266,10 +266,21 @@
         {
             m_movieState = 2;
             ThumbItem* item = m_itemList.at(m_pos);
-            QString path = QString("\"") + item->path + "\"";
+            QString path = item->path;
             QString cmd =
gContext->GetSetting("GalleryMoviePlayerCmd");
-            cmd.replace("%s", path);
-            myth_system(cmd);
+
+            // Use internal video player
+            if ( (cmd.find("internal", 0, false) > -1)||(cmd.length() <
1))
+            {
+                cmd = "Internal";
+                gContext->GetMainWindow()->HandleMedia(cmd, path);
+            }
+            else
+            {
+                cmd.replace("%s", path);
+                myth_system("\"" + cmd + "\"");
+            }
+
             if (!m_running)
             {
                 close();
Index: mythgallery/singleview.cpp
===================================================================
--- mythgallery/singleview.cpp  (revision 10024)
+++ mythgallery/singleview.cpp  (working copy)
@@ -191,10 +191,21 @@
         {
             m_movieState = 2;
             ThumbItem* item = m_itemList.at(m_pos);
-            QString path = QString("\"") + item->path + "\"";
+            QString path = item->path;
             QString cmd =
gContext->GetSetting("GalleryMoviePlayerCmd");
-            cmd.replace("%s", path);
-            myth_system(cmd);
+
+            // Use internal video player
+            if ( (cmd.find("internal", 0, false) > -1)||(cmd.length() <
1))
+            {
+                cmd = "Internal";
+                gContext->GetMainWindow()->HandleMedia(cmd, path);
+            }
+            else
+            {
+                cmd.replace("%s", path);
+                myth_system("\"" + cmd + "\"");
+            }
+
             if (!m_running)
             {
                 reject();
----PATCH END-----



More information about the mythtv-dev mailing list