From 2644df52d2262df23537438aa1e1b4294c2cd408 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Mon, 5 Nov 2012 15:40:47 -0600
Subject: mythtv: added patches for mythexpress refs #865

---
 ...tect-metadata-loads-from-multiple-threads.patch | 52 ++++++++++++++++++++++
 ...e-fe-netcontrol-play-resume-functionality.patch | 27 +++++++++++
 abs/core/mythtv/stable-0.25/mythtv/PKGBUILD        | 25 ++++++++---
 .../stable-0.25/mythtv/bonjour-correction.patch    | 32 +++++++++++++
 4 files changed, 129 insertions(+), 7 deletions(-)
 create mode 100644 abs/core/mythtv/stable-0.25/mythtv/0001-protect-metadata-loads-from-multiple-threads.patch
 create mode 100644 abs/core/mythtv/stable-0.25/mythtv/0004-restore-fe-netcontrol-play-resume-functionality.patch
 create mode 100644 abs/core/mythtv/stable-0.25/mythtv/bonjour-correction.patch

diff --git a/abs/core/mythtv/stable-0.25/mythtv/0001-protect-metadata-loads-from-multiple-threads.patch b/abs/core/mythtv/stable-0.25/mythtv/0001-protect-metadata-loads-from-multiple-threads.patch
new file mode 100644
index 0000000..d8f4a0c
--- /dev/null
+++ b/abs/core/mythtv/stable-0.25/mythtv/0001-protect-metadata-loads-from-multiple-threads.patch
@@ -0,0 +1,52 @@
+From b20171597097f8b933065ef3291c63194d310fbf Mon Sep 17 00:00:00 2001
+From: George Nassas <george@nassas.com>
+Date: Sun, 10 Jun 2012 13:36:42 -0400
+Subject: [PATCH] protect metadata loads from multiple threads
+
+---
+ mythtv/libs/libmythmetadata/dbaccess.cpp |    9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/mythtv/libs/libmythmetadata/dbaccess.cpp b/mythtv/libs/libmythmetadata/dbaccess.cpp
+index 67cd904..46adb7a 100644
+--- a/mythtv/libs/libmythmetadata/dbaccess.cpp
++++ b/mythtv/libs/libmythmetadata/dbaccess.cpp
+@@ -47,8 +47,11 @@ class SingleValueImp
+ 
+     virtual ~SingleValueImp() {}
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+@@ -271,8 +274,11 @@ class MultiValueImp
+                 .arg(m_value_name).arg(m_table_name).arg(m_id_name);
+     }
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+@@ -730,8 +736,11 @@ class FileAssociationsImp
+         }
+     }
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+-- 
+1.7.2.5
+
diff --git a/abs/core/mythtv/stable-0.25/mythtv/0004-restore-fe-netcontrol-play-resume-functionality.patch b/abs/core/mythtv/stable-0.25/mythtv/0004-restore-fe-netcontrol-play-resume-functionality.patch
new file mode 100644
index 0000000..440a37a
--- /dev/null
+++ b/abs/core/mythtv/stable-0.25/mythtv/0004-restore-fe-netcontrol-play-resume-functionality.patch
@@ -0,0 +1,27 @@
+From 2fb4b7bb111d7ec256f0b0f96c7271bcc0f61766 Mon Sep 17 00:00:00 2001
+From: George Nassas <george@nassas.com>
+Date: Fri, 24 Aug 2012 00:17:08 -0400
+Subject: [PATCH 4/4] restore fe netcontrol play/resume functionality
+
+---
+ mythtv/programs/mythfrontend/playbackbox.cpp |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
+index 734cce1..44bb343 100644
+--- a/mythtv/programs/mythfrontend/playbackbox.cpp
++++ b/mythtv/programs/mythfrontend/playbackbox.cpp
+@@ -3723,7 +3723,9 @@ void PlaybackBox::processNetworkControlCommand(const QString &command)
+ 
+                 pginfo.SetPathname(pginfo.GetPlaybackURL());
+ 
+-                PlayX(pginfo, true, true);
++		bool ignoreBookmark = tokens[1] == "PLAY";
++
++                PlayX(pginfo, ignoreBookmark, true);
+             }
+             else
+             {
+-- 
+1.7.2.5
+
diff --git a/abs/core/mythtv/stable-0.25/mythtv/PKGBUILD b/abs/core/mythtv/stable-0.25/mythtv/PKGBUILD
index 63f8b90..b599029 100644
--- a/abs/core/mythtv/stable-0.25/mythtv/PKGBUILD
+++ b/abs/core/mythtv/stable-0.25/mythtv/PKGBUILD
@@ -6,13 +6,13 @@
 
 pkgname=mythtv
 pkgver=0.25
-pkgrel=20
+pkgrel=21
 commit_hash=`cat ../git_src/git_hash`
 pkgdesc="A Homebrew PVR project $commit_hash"
 arch=('i686' 'x86_64')
 url="http://www.mythtv.org/"
 license=('GPL')
-depends=('mysql-clients' 
+depends=('mysql-clients'
          'qt'
 	 'qtwebkit'
          'lame'
@@ -20,14 +20,14 @@ depends=('mysql-clients'
          'ffmpeg'
          'fribidi'
          'perl-soap-lite'
-         'perl-date-manip' 
+         'perl-date-manip'
          'perl-xml-sax'
          'perl-math-round'
          'perl-net-upnp'
          'perl-dbd-mysql'
          'perl-time-hires'
-         'libavc1394' 
-         'wget' 
+         'libavc1394'
+         'wget'
          'libiec61883'
          'mysql-python'
          'python2-lxml'
@@ -61,8 +61,16 @@ groups=('pvr')
 #options=(!strip)
 #MAKEFLAGS="-j6"
 install='mythtv.install'
-#http://code.mythtv.org/trac/ticket/10504
-patchs=('myth_settings.patch' MythBase.php.patch )
+
+#http://code.mythtv.org/trac/ticket/10504   mythweb php
+#http://code.mythtv.org/trac/ticket/10773   mythexpress
+#http://code.mythtv.org/trac/ticket/10825   mythexpress
+#http://code.mythtv.org/trac/ticket/11032   mythexpress
+patchs=('myth_settings.patch' 'MythBase.php.patch'
+        'bonjour-correction.patch'
+        '0001-protect-metadata-loads-from-multiple-threads.patch'
+        '0004-restore-fe-netcontrol-play-resume-functionality.patch')
+
 optdepends=('xmltv: to download tv listings')
 replaces=('mythvideo' 'myththemes')
 conflicts=('mythvideo' 'myththemes')
@@ -145,6 +153,9 @@ md5sums=('7ef6de58240e7aad389a0b13d91b1cf6'
          '2babd4b8e146a7538d18dcd55695b0be'
          '322f48528b350f0e6aebfff6eab4c4ee'
          '9ec33d6956464283636c1f9a781dd4fd'
+         '8e2a055bb3beae04c88a8e603e080422'
+         '67f7316c750fba17fa578d10840b9dbd'
+         'ae23e6a8cffbe335fa37bf59978bf7a2'
          'f735805a80b0d1180dee01f9df1b7004'
          'f407d6af23e74a49540755420f84fa58'
          '5469d9921b726db750b991c87d226158')
diff --git a/abs/core/mythtv/stable-0.25/mythtv/bonjour-correction.patch b/abs/core/mythtv/stable-0.25/mythtv/bonjour-correction.patch
new file mode 100644
index 0000000..9456809
--- /dev/null
+++ b/abs/core/mythtv/stable-0.25/mythtv/bonjour-correction.patch
@@ -0,0 +1,32 @@
+From 8929314e77dfc5fe9bcc58f4ace4e7ba6fea9bef Mon Sep 17 00:00:00 2001
+From: George Nassas <george@nassas.com>
+Date: Tue, 29 May 2012 10:11:38 -0400
+Subject: [PATCH] make backend's bonjour service name dns-compliant
+
+---
+ mythtv/programs/mythbackend/mediaserver.cpp |    7 ++-----
+ 1 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/mythtv/programs/mythbackend/mediaserver.cpp b/mythtv/programs/mythbackend/mediaserver.cpp
+index 043140d..19d0eb9 100644
+--- a/mythtv/programs/mythbackend/mediaserver.cpp
++++ b/mythtv/programs/mythbackend/mediaserver.cpp
+@@ -256,13 +256,10 @@ void MediaServer::Init(bool bIsMaster, bool bDisableUPnp /* = false */)
+         m_bonjour = new BonjourRegister();
+         if (m_bonjour)
+         {
+-            QByteArray dummy;
+             QByteArray name("Mythbackend on ");
+             name.append(gCoreContext->GetHostName());
+-            m_bonjour->Register(nPort,
+-                                bIsMaster ? "_mythbackend-master._tcp" :
+-                                            "_mythbackend-slave._tcp",
+-                                name, dummy);
++            QByteArray txt(bIsMaster ? "\x0Clevel=master" : "\x0Blevel=slave");
++            m_bonjour->Register(nPort, "_mythbackend._tcp", name, txt);
+         }
+ #endif
+     }
+-- 
+1.7.2.5
+
-- 
cgit v0.12

