summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mythtv
diff options
context:
space:
mode:
authorNathan Harris <nharris@eoimaging.com>2009-02-08 22:20:20 (GMT)
committerNathan Harris <nharris@eoimaging.com>2009-02-08 22:20:20 (GMT)
commitd2cbfc286c25f31f20433e9149a0e62c4aaf900f (patch)
treedf940ae978797d62f346f465b91736b45d096649 /abs/core-testing/mythtv
parent7ee47af1a90327ecdd7ff9d790f2022545366b55 (diff)
downloadlinhes_pkgbuild-d2cbfc286c25f31f20433e9149a0e62c4aaf900f.zip
linhes_pkgbuild-d2cbfc286c25f31f20433e9149a0e62c4aaf900f.tar.gz
linhes_pkgbuild-d2cbfc286c25f31f20433e9149a0e62c4aaf900f.tar.bz2
The new structure... does not work yet.
Diffstat (limited to 'abs/core-testing/mythtv')
-rw-r--r--abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mytharchive/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythbrowser/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythcontrols/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythcontrols/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythflix/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythflix/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythgallery/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythgame/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythgame/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythmovietime/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythmusic/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythmusic/music_flac.patch (renamed from abs/core-testing/mythtv/trunk/plugins/mythmusic/music_flac.patch)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythnews/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythnews/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythphone/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythphone/PKGBUILD)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/myththemes/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/mythtv-themes/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/DeviceReadBuffer-polltimeout.2.patch219
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv-svn/PKGBUILD78
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/aacdecoder.cpp.patch12
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch139
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/is.xml33
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/knoppmyth.xml55
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/library.xml.patch13
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/mainmenu.xml.patch16
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/motion.xml20
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/mythcommflag-avidemux.2.patch179
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/patches/hdpvr-v4lchannel-tweak.patch139
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/patches/mpegrecorder-hdpvr-v1.1.patch658
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv-svn/patches/mythcommflag-avidemux.2.patch179
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/DeviceReadBuffer-polltimeout.2.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/patches/DeviceReadBuffer-polltimeout.2.patch)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/PKGBUILD76
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/aacdecoder.cpp.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/patches/aacdecoder.cpp.patch)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/compile_mythtv.sh99
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/get_mythtv.sh77
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/hdpvr-livetv.patch109
-rwxr-xr-x[-rw-r--r--]abs/core-testing/mythtv/trunk/mythtv/menu-xml/HOST_SETTINGS.xml (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/HOST_SETTINGS.xml)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/is.xml3
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/library.xml.patch13
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/linhes.xml54
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/mainmenu.xml.patch39
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/mythbackup.xml20
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/mythrestore.xml20
-rwxr-xr-x[-rw-r--r--]abs/core-testing/mythtv/trunk/mythtv/menu-xml/optical_menu.xml.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/optical_menu.xml.patch)6
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/original/create_patch.sh5
-rwxr-xr-x[-rw-r--r--]abs/core-testing/mythtv/trunk/mythtv/menu-xml/setup.xml (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/setup.xml)0
-rwxr-xr-x[-rw-r--r--]abs/core-testing/mythtv/trunk/mythtv/menu-xml/siriusmenu.xml (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/siriusmenu.xml)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/menu-xml/util_menu.xml.patch17
-rwxr-xr-x[-rw-r--r--]abs/core-testing/mythtv/trunk/mythtv/menu-xml/xmmenu.xml (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/xmmenu.xml)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/mpegrecorder-hdpvr-v2a.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/mpegrecorder-hdpvr-v1.1.patch)288
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/myth.sh (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/myth.sh)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/mythbackend (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend)3
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/mythbackend.sh (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend.sh)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythtv/mythtv.install (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/mythtv.install)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/smolt_jump.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/smolt_jump.patch)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/svn_main_menu_popup.patch (renamed from abs/core-testing/mythtv/trunk/mythtv-svn/svn_main_menu_popup.patch)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythvideo/PKGBUILD)0
-rw-r--r--abs/core-testing/mythtv/trunk/mythweather/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythweather/PKGBUILD)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/PKGBUILD (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/PKGBUILD)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/dblogininit.inc (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/xris/dblogininit.inc)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/mythweb.install (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/mythweb.install)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/mythweblighttpd.patch (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/mythweblighttpd.patch)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/xris/dblogininit.inc (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/dblogininit.inc)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/xris/lighttpd.conf (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/xris/lighttpd.conf)0
-rwxr-xr-xabs/core-testing/mythtv/trunk/mythweb/xris/mythweblighttpd.patch (renamed from abs/core-testing/mythtv/trunk/plugins/mythweb/xris/mythweblighttpd.patch)0
60 files changed, 686 insertions, 1883 deletions
diff --git a/abs/core-testing/mythtv/trunk/plugins/mytharchive/PKGBUILD b/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD
index 4d3e179..4d3e179 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mytharchive/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythbrowser/PKGBUILD b/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD
index 4c57cf0..4c57cf0 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythbrowser/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythcontrols/PKGBUILD b/abs/core-testing/mythtv/trunk/mythcontrols/PKGBUILD
index f4d6da6..f4d6da6 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythcontrols/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythcontrols/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythflix/PKGBUILD b/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD
index 9e8c92e..9e8c92e 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythflix/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythgallery/PKGBUILD b/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD
index 52fb732..52fb732 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythgallery/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythgame/PKGBUILD b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD
index 8c4257f..8c4257f 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythgame/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythmovietime/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD
index f83cdbf..f83cdbf 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythmovietime/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythmovietime/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythmusic/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD
index 28cbe82..28cbe82 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythmusic/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythmusic/music_flac.patch b/abs/core-testing/mythtv/trunk/mythmusic/music_flac.patch
index b152249..b152249 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythmusic/music_flac.patch
+++ b/abs/core-testing/mythtv/trunk/mythmusic/music_flac.patch
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythnews/PKGBUILD b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD
index 4dafc20..4dafc20 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythnews/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythphone/PKGBUILD b/abs/core-testing/mythtv/trunk/mythphone/PKGBUILD
index f6bf3ec..f6bf3ec 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythphone/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythphone/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/mythtv-themes/PKGBUILD b/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD
index 8cd0d04..8cd0d04 100755
--- a/abs/core-testing/mythtv/trunk/mythtv-themes/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/DeviceReadBuffer-polltimeout.2.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/DeviceReadBuffer-polltimeout.2.patch
deleted file mode 100644
index 5bb713f..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/DeviceReadBuffer-polltimeout.2.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-Index: libs/libmythtv/DeviceReadBuffer.h
-===================================================================
---- libs/libmythtv/DeviceReadBuffer.h (revision 18515)
-+++ libs/libmythtv/DeviceReadBuffer.h (working copy)
-@@ -59,7 +59,7 @@
- void IncrReadPointer(uint len);
-
- bool HandlePausing(void);
-- bool Poll(void) const;
-+ bool Poll(void);
- uint WaitForUnused(uint bytes_needed) const;
- uint WaitForUsed (uint bytes_needed) const;
-
-Index: libs/libmythtv/DeviceReadBuffer.cpp
-===================================================================
---- libs/libmythtv/DeviceReadBuffer.cpp (revision 18515)
-+++ libs/libmythtv/DeviceReadBuffer.cpp (working copy)
-@@ -90,9 +90,14 @@
-
- void DeviceReadBuffer::Start(void)
- {
-- lock.lock();
-- bool was_running = running;
-- lock.unlock();
-+ bool was_running;
-+
-+ {
-+ QMutexLocker locker(&lock);
-+ was_running = running;
-+ error = false;
-+ }
-+
- if (was_running)
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + "Start(): Already running.");
-@@ -104,6 +109,8 @@
- {
- VERBOSE(VB_IMPORTANT,
- LOC_ERR + QString("Start(): pthread_create failed.") + ENO);
-+
-+ QMutexLocker locker(&lock);
- error = true;
- }
- }
-@@ -118,21 +125,25 @@
- used = 0;
- readPtr = buffer;
- writePtr = buffer;
-+
-+ error = false;
- }
-
- void DeviceReadBuffer::Stop(void)
- {
- bool was_running = IsRunning();
-- lock.lock();
-- run = false;
-- lock.unlock();
-
- if (!was_running)
- {
-- VERBOSE(VB_IMPORTANT, LOC_ERR + "Stop(): Not running.");
-+ VERBOSE(VB_IMPORTANT, LOC + "Stop(): Not running.");
- return;
- }
-
-+ {
-+ QMutexLocker locker(&lock);
-+ run = false;
-+ }
-+
- pthread_join(thread, NULL);
- }
-
-@@ -229,10 +240,11 @@
- {
- uint errcnt = 0;
-
-- lock.lock();
-- run = true;
-- running = true;
-- lock.unlock();
-+ {
-+ QMutexLocker locker(&lock);
-+ run = true;
-+ running = true;
-+ }
-
- while (run)
- {
-@@ -248,6 +260,15 @@
- if (using_poll && !Poll())
- continue;
-
-+ {
-+ QMutexLocker locker(&lock);
-+ if (error)
-+ {
-+ VERBOSE(VB_RECORD, LOC + "fill_ringbuffer: error state");
-+ break;
-+ }
-+ }
-+
- // Limit read size for faster return from read
- size_t read_size =
- min(dev_read_size, (size_t) WaitForUnused(TSPacket::SIZE));
-@@ -268,9 +289,10 @@
- }
- }
-
-- lock.lock();
-- running = false;
-- lock.unlock();
-+ {
-+ QMutexLocker locker(&lock);
-+ running = false;
-+ }
- }
-
- bool DeviceReadBuffer::HandlePausing(void)
-@@ -293,7 +315,7 @@
- return true;
- }
-
--bool DeviceReadBuffer::Poll(void) const
-+bool DeviceReadBuffer::Poll(void)
- {
- #ifdef USING_MINGW
- #warning mingw DeviceReadBuffer::Poll
-@@ -302,31 +324,53 @@
- return false;
- #else
- bool retval = true;
-- while (true)
-+ uint timeout_cnt = 0;
-+
-+ for (;;)
- {
- struct pollfd polls;
- polls.fd = _stream_fd;
- polls.events = POLLIN;
- polls.revents = 0;
-
-- int ret = poll(&polls, 1 /*number of polls*/, 10 /*msec*/);
-- if (IsPauseRequested() || !IsOpen() || !run)
-+ int ret = poll(&polls, 1 /*number of polls*/, 250 /*msec*/);
-+
-+ if (polls.revents & (POLLERR | POLLHUP | POLLNVAL))
- {
-+ VERBOSE(VB_IMPORTANT, LOC + "poll error");
-+ error = true;
-+ return true;
-+ }
-+
-+ if (!run || !IsOpen() || IsPauseRequested())
-+ {
- retval = false;
- break; // are we supposed to pause, stop, etc.
- }
-
- if (ret > 0)
- break; // we have data to read :)
-- if ((-1 == ret) && (EOVERFLOW == errno))
-- break; // we have an error to handle
--
-- if ((-1 == ret) && ((EAGAIN == errno) || (EINTR == errno)))
-- continue; // errors that tell you to try again
-- if (ret == 0)
-- continue; // timed out, try again
--
-- usleep(2500);
-+ if (ret < 0)
-+ {
-+ if ((EOVERFLOW == errno))
-+ break; // we have an error to handle
-+ if ((EAGAIN == errno) || (EINTR == errno))
-+ continue; // errors that tell you to try again
-+ usleep(2500);
-+ }
-+ else // ret == 0
-+ {
-+ if (++timeout_cnt > 9)
-+ {
-+ VERBOSE(VB_RECORD, LOC_ERR + "Poll giving up");
-+ QMutexLocker locker(&lock);
-+ error = true;
-+ return true;
-+ }
-+ if (timeout_cnt % 2)
-+ VERBOSE(VB_RECORD, LOC_ERR + QString("Poll timeout (%1)")
-+ .arg(timeout_cnt));
-+ }
- }
- return retval;
- #endif //!USING_MINGW
-@@ -360,9 +404,9 @@
-
- if (++errcnt > 5)
- {
-- lock.lock();
-+ QMutexLocker locker(&lock);
-+ VERBOSE(VB_RECORD, LOC + "Too many errors.");
- error = true;
-- lock.unlock();
- return false;
- }
-
-@@ -376,10 +420,8 @@
- VERBOSE(VB_IMPORTANT, LOC +
- QString("End-Of-File? fd(%1)").arg(_stream_fd));
-
-- lock.lock();
-+ QMutexLocker locker(&lock);
- eof = true;
-- lock.unlock();
--
- return false;
- }
- usleep(500);
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/PKGBUILD b/abs/core-testing/mythtv/trunk/mythtv-svn/PKGBUILD
deleted file mode 100755
index b5dc31d..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/PKGBUILD
+++ /dev/null
@@ -1,78 +0,0 @@
-pkgname=mythtv-svn
-pkgver=19295
-pkgrel=1
-pkgdesc="A personal video recorder for Linux"
-url="http://www.mythtv.org"
-license="GPL"
-depends=('lame' 'libmysqlclient' 'alsa-lib' 'wget' 'qt' 'x-server' 'freetype2' 'libmpeg2' 'libxml2' 'libraw1394' 'lirc' 'perl-date-manip' 'libavc1394' 'libdc1394' 'libiec61883')
-makedepends=('subversion')
-conflicts=(mythtv)
-replaces=()
-backup=()
-options=(!strip)
-MAKEFLAGS="-j6"
-install='mythtv.install'
-
-patchs=('DeviceReadBuffer-polltimeout.2.patch' 'hdpvr-v4lchannel-tweak.patch' 'mpegrecorder-hdpvr-v1.1.patch' 'mythcommflag-avidemux.2.patch')
-source=('mythbackend' 'myth.sh' 'smolt_jump.patch' 'svn_main_menu_popup.patch' `echo ${patchs[@]:0}` )
-arch=('i686')
-md5sums=()
-
-
-
-_svntrunk=http://cvs.mythtv.org/svn/trunk/mythtv
-_svnmod=mythtv
-
-build() {
-
- svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
- cd $startdir/src/mythtv
- echo "--------------------------applying patches----------------------------------------------------"
- patch -Np0 -i $startdir/src/smolt_jump.patch #|| return 1
- patch -Np0 -i $startdir/src/svn_main_menu_popup.patch #||return 1
-
- for i in `echo ${patchs[@]:0} `
- do
- echo applying $i
- echo "------------"
- patch -Np0 -i ${startdir}/src/$i #|| return 1
- done
- echo "--------------------------done applying patches----------------------------------------------------"
- sed -i -e "s/\`(svnversion \$\${SVNTREEDIR} 2>\/dev\/null) || echo Unknown\`/$pkgver/" version.pro
- make distclean
- ./configure --prefix=/usr --enable-xvmc --enable-xvmc-pro --enable-opengl-vsync --enable-dvb --enable-firewire --compile-type=release --with-bindings=perl --disable-audio-arts --disable-xrandr
- . /etc/profile
- make
- make INSTALL_ROOT=$startdir/pkg install
-
- #Patch the xml LinHES style
- cp -r $startdir/menu-xml/*.xml $startdir/pkg/usr/share/mythtv
- cd $startdir/pkg/usr/share/mythtv
- patch -p0 < $startdir/menu-xml/mainmenu.xml.patch
- patch -p0 < $startdir/menu-xml/optical_menu.xml.patch
- patch -p0 < $startdir/menu-xml/library.xml.patch
-
- # mkdir -p $startdir/pkg/usr/share/mythtv/contrib
- # mkdir -p $startdir/pkg/etc/rc.d
- # mkdir -p $startdir/pkg/var/log/mythtv
- # mkdir -p $startdir/pkg/etc/profile.d
- # install -m0755 ../myth.sh $startdir/pkg/etc/profile.d/
-
- # install contrib
- # mkdir -p $startdir/pkg/usr/local/share/mythtv/contrib || return 1
- # cp -rp contrib/* $startdir/pkg/usr/local/share/mythtv/contrib
- # echo "-release-fixes" > $startdir/pkg/usr/local/share/mythtv/.releasetype
- # install -m0755 themes/*.ttf $startdir/pkg/usr/local/share/mythtv/themes/
-
-
- # mkdir -p $startdir/pkg/usr/lib/
- # mv $startdir/pkg/usr/local/lib/perl5 $startdir/pkg/usr/lib/perl5
- # cd $startdir/src/mythtv/contrib
- # gcc -Wall -o firewire_tester firewire_tester.c -liec61883 -lraw1394
- # install -m0755 firewire_tester $startdir/pkg/usr/local/bin/firewire_tester
- #install -m0755 $startdir/pkg/usr/local/share/mythtv/contrib/optimize_mythdb.pl $startdir/pkg/usr/local/bin/optimize_mythdb.pl
- # cp $startdir/src/myth.find_orphans.pl $startdir/pkg/usr/local/share/mythtv/contrib/myth.find_orphans.pl
- # install -m0755 $startdir/pkg/usr/local/share/mythtv/contrib/myth.find_orphans.pl $startdir/pkg/usr/local/bin/myth.find_orphans.pl
-
-
-}
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/aacdecoder.cpp.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/aacdecoder.cpp.patch
deleted file mode 100644
index 8796eb4..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/aacdecoder.cpp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- mythmusic/mythmusic/aacdecoder.cpp.orig 2008-11-19 12:51:48.000000000 -0500
-+++ mythmusic/mythmusic/aacdecoder.cpp 2008-11-19 12:52:42.000000000 -0500
-@@ -17,6 +17,9 @@
- #define FAAD_MODIFIED
- #endif
-
-+// LinHES need this undefined
-+#undef FAAD_MODIFIED
-+
- // ANSI C headers
- #include <cstdlib>
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch
deleted file mode 100644
index 3535310..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/hdpvr-v4lchannel-tweak.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Index: libs/libmythtv/v4lchannel.h
-===================================================================
---- libs/libmythtv/v4lchannel.h (revision 18874)
-+++ libs/libmythtv/v4lchannel.h (working copy)
-@@ -103,6 +103,8 @@
- VidModV4L2 videomode_v4l2; ///< Current video mode if 'usingv4l2' is true
-
- int defaultFreqTable;
-+ int prev_inputNumV4L;
-+ v4l2_std_id prev_vid_mode;
- };
-
- #endif
-Index: libs/libmythtv/v4lchannel.cpp
-===================================================================
---- libs/libmythtv/v4lchannel.cpp (revision 18874)
-+++ libs/libmythtv/v4lchannel.cpp (working copy)
-@@ -40,7 +40,8 @@
- device_name(QString::null), driver_name(QString::null),
- curList(NULL), totalChannels(0),
- currentFormat(""), is_dtv(false),
-- usingv4l2(false), defaultFreqTable(1)
-+ usingv4l2(false), defaultFreqTable(1),
-+ prev_inputNumV4L(-1), prev_vid_mode(-1)
- {
- }
-
-@@ -795,62 +796,75 @@
- {
- VERBOSE(VB_CHANNEL, LOC + msg + "(v4l v2)");
-
-- int ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+ int ioctlval;
-+ bool streamingDisabled = false;
-+ int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
-- // ConvertX (wis-go7007) requires streaming to be disabled
-- // before an input switch, do this if initial switch failed.
-- bool streamingDisabled = false;
-- int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-- if ((ioctlval < 0) && (errno == EBUSY))
-+ if (prev_inputNumV4L != inputNumV4L)
- {
-- ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType);
-+ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+
-+ // ConvertX (wis-go7007) requires streaming to be disabled
-+ // before an input switch, do this if initial switch failed.
-+ if ((ioctlval < 0) && (errno == EBUSY))
-+ {
-+ ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType);
-+ if (ioctlval < 0)
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-+ "\n\t\t\twhile disabling streaming (v4l v2)" + ENO);
-+
-+ ok = false;
-+ ioctlval = 0;
-+ }
-+ else
-+ {
-+ streamingDisabled = true;
-+
-+ // Resend the input switch ioctl.
-+ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+ }
-+ }
-+
- if (ioctlval < 0)
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile disabling streaming (v4l v2)" + ENO);
-+ "\n\t\t\twhile setting input (v4l v2)" + ENO);
-
- ok = false;
-- ioctlval = 0;
- }
-- else
-- {
-- streamingDisabled = true;
-
-- // Resend the input switch ioctl.
-- ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-- }
-+ prev_inputNumV4L = inputNumV4L;
- }
-
-- if (ioctlval < 0)
-- {
-- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile setting input (v4l v2)" + ENO);
--
-- ok = false;
-- }
--
- v4l2_std_id vid_mode = format_to_mode(newFmt, 2);
-- ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode);
-- if (ioctlval < 0)
-- {
-- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile setting format (v4l v2)" + ENO);
-
-- ok = false;
-- }
--
-- // ConvertX (wis-go7007) requires streaming to be disabled
-- // before an input switch, here we try to re-enable streaming.
-- if (streamingDisabled)
-+ if (prev_vid_mode != vid_mode)
- {
-- ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType);
-+ ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode);
- if (ioctlval < 0)
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile reenabling streaming (v4l v2)" + ENO);
-+ "\n\t\t\twhile setting format (v4l v2)" + ENO);
-
- ok = false;
- }
-+
-+ // ConvertX (wis-go7007) requires streaming to be disabled
-+ // before an input switch, here we try to re-enable streaming.
-+ if (streamingDisabled)
-+ {
-+ ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType);
-+ if (ioctlval < 0)
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-+ "\n\t\t\twhile reenabling streaming (v4l v2)" +
-+ ENO);
-+
-+ ok = false;
-+ }
-+ }
-+ prev_vid_mode = vid_mode;
- }
- }
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/is.xml b/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/is.xml
deleted file mode 100644
index 65935cf..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/is.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<mythmenu name="Internet Steams">
- <button>
- <type>MOVIETIMES</type>
- <text>Apple Trailers</text>
- <action>MENU appletrailer.xml</action>
- </button>
-
- <button>
- <type>STREAM</type>
- <text>MythStream</text>
- <action>PLUGIN mythstream</action>
- <depends>mythstream</depends>
- </button>
-
- <button>
- <type>STREAM</type>
- <text>Miro Player</text>
- <action>EXEC /usr/bin/democracyplayer</action>
- </button>
-
- <button>
- <type>KnoppMyth</type>
- <text>Sirius Satellite Radio</text>
- <action>MENU siriusmenu.xml</action>
- </button>
-
- <button>
- <type>KnoppMyth</type>
- <text>XM Satellite Radio</text>
- <action>MENU xmmenu.xml</action>
- </button>
-
-</mythmenu>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/knoppmyth.xml b/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/knoppmyth.xml
deleted file mode 100644
index 8aa6134..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/knoppmyth.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<mythmenu name="KnoppMyth">
-
- <button>
- <type>BACKUP</type>
- <text>Backup KnoppMyth</text>
- <action>MENU mythbackup.xml</action>
- </button>
-
- <button>
- <type>RESTORE</type>
- <text>Restore KnoppMyth</text>
- <action>MENU mythrestore.xml</action>
- </button>
-
- <button>
- <type>Motion</type>
- <text>Motion</text>
- <action>MENU motion.xml</action>
- </button>
-<!--
- <button>
- <type>POWER</type>
- <text>Power Off </text>
- <action>EXEC /usr/bin/sudo halt</action>
- </button>
-
- <button>
- <type>POWER</type>
- <text>Reboot</text>
- <action>EXEC /usr/bin/sudo reboot</action>
- </button>
-
- <button>
- <type>VERSION</type>
- <text>Version</text>
- <action>EXEC /usr/local/bin/ver.sh</action>
- </button>
--->
-
- <button>
- <type>MV_SETUP_MENU</type>
- <text>MythVantage Settings</text>
- <action>MENU HOST_SETTINGS.xml</action>
-
- </button>
-<!--
- <button>
- <type>MV_TEMPLATE</type>
- <text>Settings profile manager</text>
- <action>EXEC mythinstall -t </action>
-
- </button>
--->
-</mythmenu>
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/library.xml.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/library.xml.patch
deleted file mode 100644
index ef08f0c..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/library.xml.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- library.xml.orig 2008-11-13 11:26:10.000000000 -0500
-+++ library.xml 2008-11-19 11:55:55.000000000 -0500
-@@ -120,9 +120,7 @@
- <button>
- <type>STREAM</type>
- <text>Play Online Streams</text>
-- <text lang="HE">נגן מדיה מכוונת</text>
-- <action>PLUGIN mythstream</action>
-- <depends>mythstream</depends>
-+ <action>MENU is.xml</action>
- </button>
-
- <button>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/mainmenu.xml.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/mainmenu.xml.patch
deleted file mode 100644
index f4f57f1..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/mainmenu.xml.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- mainmenu.xml.orig 2008-11-13 11:26:10.000000000 -0500
-+++ mainmenu.xml 2008-11-19 12:01:57.000000000 -0500
-@@ -188,6 +188,13 @@
- <action>MENU util_menu.xml</action>
- </button>
-
-+
-+ <button>
-+ <type>MENU_UTILITIES_SETUP</type>
-+ <text>Service Menu</text>
-+ <action>MENU knoppmyth.xml</action>
-+ </button>
-+
- <!-- <button>
- <type>SHUTDOWN</type>
- <text>Shutdown</text>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/motion.xml b/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/motion.xml
deleted file mode 100644
index 23ebfe2..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/motion.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<mythmenu name="Motion">
-
- <button>
- <type>MOTION</type>
- <text>Start Motion</text>
- <action>EXEC sudo /etc/init.d/motion start</action>
- </button>
-
- <button>
- <type>MOTION</type>
- <text>Stop Motion</text>
- <action>EXEC sudo /etc/init.d/motion stop</action>
- </button>
-
- <button>
- <type>MOTION</type>
- <text>Clear Motion</text>
- <action>EXEC /usr/local/bin/cm.sh</action>
- </button>
-</mythmenu>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/mythcommflag-avidemux.2.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/mythcommflag-avidemux.2.patch
deleted file mode 100644
index d26645f..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/mythcommflag-avidemux.2.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-Index: programs/mythcommflag/main.cpp
-===================================================================
---- programs/mythcommflag/main.cpp (revision 18596)
-+++ programs/mythcommflag/main.cpp (working copy)
-@@ -300,6 +300,132 @@
- return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS;
- }
-
-+int GetAviDemux(QString list, QString chanid, QString starttime, const QString &outputfilename)
-+{
-+ QMap<long long, int> cutlist;
-+ QMap<long long, int>::Iterator it;
-+ QString result;
-+ int startValue = 0;
-+ long long myTotalFrames;
-+ long long myFrameRate;
-+
-+ ProgramInfo *pginfo =
-+ ProgramInfo::GetProgramFromRecorded(chanid, starttime);
-+
-+ NuppelVideoPlayer* nvp = new NuppelVideoPlayer("avidemux_export", pginfo);
-+
-+ myFrameRate = (long long)(nvp->GetFrameRate() * 1000);
-+ myTotalFrames = 1000000; //nvp->GetTotalFrameCount();
-+
-+ if (!pginfo)
-+ {
-+ VERBOSE(VB_IMPORTANT,
-+ QString("No program data exists for channel %1 at %2")
-+ .arg(chanid).arg(starttime));
-+ return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA;
-+ }
-+
-+ QString filename = pginfo->GetPlaybackURL(TRUE);
-+
-+ if (list == "cutlist")
-+ pginfo->GetCutList(cutlist);
-+ else
-+ pginfo->GetCommBreakList(cutlist);
-+
-+// Formatting of output data
-+
-+ for (it = cutlist.begin(); it != cutlist.end(); ++it)
-+ {
-+ if ((it.key() == 0) && (startValue == 0)) // Cutlist starts on first frame,
-+ {
-+ ++it;
-+ startValue = it.key();
-+ }
-+
-+ if ((it.key() != 0) && (startValue == 0)) // Cutlist starts on non-first frame
-+ {
-+ result += QString("app.addSegment(0,0,%1);").arg(it.key());
-+ startValue = it.key();
-+ }
-+ else
-+ {
-+ if ((*it == MARK_COMM_END) && (startValue != 0) ||
-+ (*it == MARK_CUT_END) && (startValue != 0))
-+ {
-+ if (result != "")
-+ result += "\n";
-+ startValue = it.key();
-+ result += QString("app.addSegment(0,%1,").arg(it.key()); // Value is a start value
-+ }
-+ else
-+ {
-+ result += QString("%1);").arg(it.key() - startValue); // Value is an end value
-+ }
-+ }
-+ }
-+
-+if (it.key() != myTotalFrames)
-+ {
-+ result += QString("%1);").arg(myTotalFrames);
-+ }
-+
-+// Governs the file output:
-+
-+ QString tmp = "";
-+ ostream *out = &cout;
-+
-+ if (outputfilename != "-"){
-+ QByteArray tmp = outputfilename.toLocal8Bit();
-+ out = new fstream(tmp.constData(), ios::app | ios::out );
-+ }
-+
-+ if (outputfilename == ""){
-+ VERBOSE(VB_IMPORTANT,
-+ QString("Error: AVIDemux output requires the use of the --outputfile option."));
-+ return COMMFLAG_EXIT_INVALID_CMDLINE;
-+ }
-+
-+ tmp = QString("//AD <- Needed to identify//\n"
-+ "//--automatically built--\n"
-+ "//--Project:\n\n"
-+ "var app = new Avidemux();\n\n"
-+ "//** Video **\n"
-+ "// 01 videos source\n"
-+ "app.load(\"%1\");\n\n"
-+ "app.clearSegments();\n\n"
-+ "%2\n"
-+ "app.markerA=0;\n"
-+ "app.markerB=%3;\n"
-+ "app.rebuildIndex();\n\n"
-+ "//** Postproc **\n"
-+ "app.video.setPostProc(3,3,0);\n\n"
-+ "app.video.setFps1000(%4);\n\n"
-+ "//** Filters **\n\n"
-+ "//** Video Codec conf **\n"
-+ "app.video.codec(\"Copy\",\"CQ=4\",\"0 \");\n\n"
-+ "//** Audio **\n"
-+ "app.audio.reset();\n"
-+ "app.audio.codec(\"copy\",128,0,\"\");\n"
-+ "app.audio.normalizeMode=0;\n"
-+ "app.audio.normalizeValue=0;\n"
-+ "app.audio.delay=0;\n"
-+ "app.audio.mixer(\"NONE\");\n"
-+ "app.setContainer(\"AVI\");\n"
-+ "setSuccess(1);\n"
-+ "//app.Exit();\n\n"
-+ "//End of script\n").arg(filename).arg(result).arg(myTotalFrames).arg(myFrameRate).toLocal8Bit().constData();
-+
-+ const QByteArray tmp2 = tmp.toLocal8Bit();
-+ *out << tmp2.constData() << endl;
-+
-+ VERBOSE(VB_IMPORTANT,
-+ QString("AVIDemux Project generated for %1 at %2 with filename %3.")
-+ .arg(chanid).arg(starttime).arg(outputfilename));
-+
-+ return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS;
-+}
-+
-+
- void streamOutCommercialBreakList(
- ostream &output, const QMap<long long, int> &commercialBreakList)
- {
-@@ -811,6 +937,8 @@
- bool clearCutlist = false;
- bool getCutlist = false;
- bool getSkipList = false;
-+ bool getAviDemuxCutlist = false;
-+ bool getAviDemuxSkiplist = false;
- QString newCutList = QString::null;
- QMap<QString, QString> settingsOverride;
-
-@@ -960,6 +1088,10 @@
- getCutlist = true;
- else if (!strcmp(a.argv()[argpos], "--getskiplist"))
- getSkipList = true;
-+ else if (!strcmp(a.argv()[argpos], "--getcutlist-avidemux"))
-+ getAviDemuxCutlist = true;
-+ else if (!strcmp(a.argv()[argpos], "--getskiplist-avidemux"))
-+ getAviDemuxSkiplist = true;
- else if (!strcmp(a.argv()[argpos], "--setcutlist"))
- newCutList = (a.argv()[++argpos]);
- else if (!strcmp(a.argv()[argpos], "-j"))
-@@ -1111,6 +1243,8 @@
- " #-#[,#-#]... (ie, 1-100,1520-3012,4091-5094\n"
- "--getcutlist Display the current cutlist\n"
- "--getskiplist Display the current Commercial Skip list\n"
-+ "--getcutlist-avidemux Export cutlist as AVIDemux Project File\n"
-+ "--getskiplist-avidemux Export skiplist as AVIDemux Project File\n"
- "-v or --verbose debug-level Use '-v help' for level info\n"
- "--queue Insert flagging job into the JobQueue rather than\n"
- " running flagging in the foreground\n"
-@@ -1223,6 +1357,12 @@
- if (!newCutList.isNull())
- return SetCutList(chanid, starttime, newCutList);
-
-+ if (getAviDemuxCutlist)
-+ return GetAviDemux("cutlist", chanid, starttime, outputfilename);
-+
-+ if (getAviDemuxSkiplist)
-+ return GetAviDemux("commflag", chanid, starttime, outputfilename);
-+
- if (getCutlist)
- return GetMarkupList("cutlist", chanid, starttime);
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/hdpvr-v4lchannel-tweak.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/patches/hdpvr-v4lchannel-tweak.patch
deleted file mode 100644
index 3535310..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/hdpvr-v4lchannel-tweak.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Index: libs/libmythtv/v4lchannel.h
-===================================================================
---- libs/libmythtv/v4lchannel.h (revision 18874)
-+++ libs/libmythtv/v4lchannel.h (working copy)
-@@ -103,6 +103,8 @@
- VidModV4L2 videomode_v4l2; ///< Current video mode if 'usingv4l2' is true
-
- int defaultFreqTable;
-+ int prev_inputNumV4L;
-+ v4l2_std_id prev_vid_mode;
- };
-
- #endif
-Index: libs/libmythtv/v4lchannel.cpp
-===================================================================
---- libs/libmythtv/v4lchannel.cpp (revision 18874)
-+++ libs/libmythtv/v4lchannel.cpp (working copy)
-@@ -40,7 +40,8 @@
- device_name(QString::null), driver_name(QString::null),
- curList(NULL), totalChannels(0),
- currentFormat(""), is_dtv(false),
-- usingv4l2(false), defaultFreqTable(1)
-+ usingv4l2(false), defaultFreqTable(1),
-+ prev_inputNumV4L(-1), prev_vid_mode(-1)
- {
- }
-
-@@ -795,62 +796,75 @@
- {
- VERBOSE(VB_CHANNEL, LOC + msg + "(v4l v2)");
-
-- int ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+ int ioctlval;
-+ bool streamingDisabled = false;
-+ int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
-- // ConvertX (wis-go7007) requires streaming to be disabled
-- // before an input switch, do this if initial switch failed.
-- bool streamingDisabled = false;
-- int streamType = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-- if ((ioctlval < 0) && (errno == EBUSY))
-+ if (prev_inputNumV4L != inputNumV4L)
- {
-- ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType);
-+ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+
-+ // ConvertX (wis-go7007) requires streaming to be disabled
-+ // before an input switch, do this if initial switch failed.
-+ if ((ioctlval < 0) && (errno == EBUSY))
-+ {
-+ ioctlval = ioctl(videofd, VIDIOC_STREAMOFF, &streamType);
-+ if (ioctlval < 0)
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-+ "\n\t\t\twhile disabling streaming (v4l v2)" + ENO);
-+
-+ ok = false;
-+ ioctlval = 0;
-+ }
-+ else
-+ {
-+ streamingDisabled = true;
-+
-+ // Resend the input switch ioctl.
-+ ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-+ }
-+ }
-+
- if (ioctlval < 0)
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile disabling streaming (v4l v2)" + ENO);
-+ "\n\t\t\twhile setting input (v4l v2)" + ENO);
-
- ok = false;
-- ioctlval = 0;
- }
-- else
-- {
-- streamingDisabled = true;
-
-- // Resend the input switch ioctl.
-- ioctlval = ioctl(videofd, VIDIOC_S_INPUT, &inputNumV4L);
-- }
-+ prev_inputNumV4L = inputNumV4L;
- }
-
-- if (ioctlval < 0)
-- {
-- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile setting input (v4l v2)" + ENO);
--
-- ok = false;
-- }
--
- v4l2_std_id vid_mode = format_to_mode(newFmt, 2);
-- ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode);
-- if (ioctlval < 0)
-- {
-- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile setting format (v4l v2)" + ENO);
-
-- ok = false;
-- }
--
-- // ConvertX (wis-go7007) requires streaming to be disabled
-- // before an input switch, here we try to re-enable streaming.
-- if (streamingDisabled)
-+ if (prev_vid_mode != vid_mode)
- {
-- ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType);
-+ ioctlval = ioctl(videofd, VIDIOC_S_STD, &vid_mode);
- if (ioctlval < 0)
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-- "\n\t\t\twhile reenabling streaming (v4l v2)" + ENO);
-+ "\n\t\t\twhile setting format (v4l v2)" + ENO);
-
- ok = false;
- }
-+
-+ // ConvertX (wis-go7007) requires streaming to be disabled
-+ // before an input switch, here we try to re-enable streaming.
-+ if (streamingDisabled)
-+ {
-+ ioctlval = ioctl(videofd, VIDIOC_STREAMON, &streamType);
-+ if (ioctlval < 0)
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + msg +
-+ "\n\t\t\twhile reenabling streaming (v4l v2)" +
-+ ENO);
-+
-+ ok = false;
-+ }
-+ }
-+ prev_vid_mode = vid_mode;
- }
- }
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mpegrecorder-hdpvr-v1.1.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mpegrecorder-hdpvr-v1.1.patch
deleted file mode 100644
index f292b7f..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mpegrecorder-hdpvr-v1.1.patch
+++ /dev/null
@@ -1,658 +0,0 @@
-Index: libs/libmythtv/mpegrecorder.h
-===================================================================
---- libs/libmythtv/mpegrecorder.h (revision 19056)
-+++ libs/libmythtv/mpegrecorder.h (working copy)
-@@ -80,11 +80,13 @@
- uint GetFilteredAudioLayer(void) const;
- uint GetFilteredAudioBitRate(uint audio_layer) const;
-
-+ void RestartEncoding(void);
- bool StartEncoding(int fd);
- bool StopEncoding(int fd);
-
- void ResetForNewFile(void);
-
-+ bool WaitFor_HDPVR(void);
- void HandleResolutionChanges(void);
-
- inline bool CheckCC(uint pid, uint cc);
-@@ -104,7 +106,6 @@
- // State
- bool recording;
- bool encoding;
-- bool needs_resolution;
- mutable QMutex start_stop_encoding_lock;
- QMutex recording_wait_lock;
- QWaitCondition recording_wait;
-@@ -113,7 +114,7 @@
- bool cleartimeonpause;
-
- // Encoding info
-- int width, height;
-+ uint width, height;
- int bitrate, maxbitrate, streamtype, aspectratio;
- int audtype, audsamplerate, audbitratel1, audbitratel2, audbitratel3;
- int audvolume;
-Index: libs/libmythtv/mpegrecorder.cpp
-===================================================================
---- libs/libmythtv/mpegrecorder.cpp (revision 19056)
-+++ libs/libmythtv/mpegrecorder.cpp (working copy)
-@@ -19,6 +19,7 @@
- #include <sys/stat.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
-+#include <sys/poll.h>
-
- // avlib headers
- extern "C" {
-@@ -86,7 +87,7 @@
- requires_special_pause(false),
- // State
- recording(false), encoding(false),
-- needs_resolution(false), start_stop_encoding_lock(QMutex::Recursive),
-+ start_stop_encoding_lock(QMutex::Recursive),
- recording_wait_lock(), recording_wait(),
- // Pausing state
- cleartimeonpause(false),
-@@ -487,13 +488,21 @@
-
- bool MpegRecorder::SetFormat(int chanfd)
- {
-+ uint idx;
- struct v4l2_format vfmt;
- bzero(&vfmt, sizeof(vfmt));
-
- vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
-- if (ioctl(chanfd, VIDIOC_G_FMT, &vfmt) < 0)
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_G_FMT, &vfmt) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 10)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_ERR + "Error getting format" + ENO);
- return false;
- }
-@@ -501,8 +510,15 @@
- vfmt.fmt.pix.width = width;
- vfmt.fmt.pix.height = height;
-
-- if (ioctl(chanfd, VIDIOC_S_FMT, &vfmt) < 0)
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_S_FMT, &vfmt) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_ERR + "Error setting format" + ENO);
- return false;
- }
-@@ -513,10 +529,19 @@
- /// Set audio language mode
- bool MpegRecorder::SetLanguageMode(int chanfd)
- {
-+ uint idx;
- struct v4l2_tuner vt;
- bzero(&vt, sizeof(struct v4l2_tuner));
-- if (ioctl(chanfd, VIDIOC_G_TUNER, &vt) < 0)
-+
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_G_TUNER, &vt) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN + "Unable to get audio mode" + ENO);
- return false;
- }
-@@ -549,8 +574,15 @@
- success = false;
- }
-
-- if (ioctl(chanfd, VIDIOC_S_TUNER, &vt) < 0)
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_S_TUNER, &vt) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN + "Unable to set audio mode" + ENO);
- success = false;
- }
-@@ -561,10 +593,19 @@
- bool MpegRecorder::SetRecordingVolume(int chanfd)
- {
- // Get volume min/max values
-+ uint idx;
- struct v4l2_queryctrl qctrl;
- qctrl.id = V4L2_CID_AUDIO_VOLUME;
-- if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) < 0)
-+
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN +
- "Unable to get recording volume parameters(max/min)" + ENO +
- "\n\t\t\tusing default range [0,65535].");
-@@ -582,8 +623,15 @@
- ctrl.id = V4L2_CID_AUDIO_VOLUME;
- ctrl.value = ctrl_volume;
-
-- if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) < 0)
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN +
- "Unable to set recording volume" + ENO + "\n\t\t\t" +
- "If you are using an AverMedia M179 card this is normal.");
-@@ -765,6 +813,7 @@
-
- for (uint i = 0; i < ext_ctrls.size(); i++)
- {
-+ uint idx;
- struct v4l2_ext_controls ctrls;
- bzero(&ctrls, sizeof(struct v4l2_ext_controls));
-
-@@ -774,8 +823,15 @@
- ctrls.count = 1;
- ctrls.controls = &ext_ctrls[i];
-
-- if (ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0)
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- QMutexLocker locker(&control_description_lock);
- VERBOSE(VB_IMPORTANT, QString("mpegrecorder.cpp:set_ctrls(): ") +
- QString("Could not set %1 to %2")
-@@ -814,6 +870,30 @@
- {
- maxbitrate = high_mpeg4peakbitrate;
- bitrate = high_mpeg4avgbitrate;
-+
-+ // query supported audio codecs and prefer AC3
-+ uint idx;
-+ struct v4l2_queryctrl qctrl;
-+ qctrl.id = V4L2_CID_MPEG_AUDIO_ENCODING;
-+
-+ for (idx = 0; idx < 20; ++idx)
-+ {
-+ if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_WARN +
-+ "Unable to get supported audio codecs." + ENO);
-+ }
-+ else
-+ {
-+ if (qctrl.minimum != qctrl.maximum)
-+ add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_AUDIO_ENCODING,
-+ qctrl.maximum);
-+ }
- }
- maxbitrate = std::max(maxbitrate, bitrate);
-
-@@ -837,19 +917,36 @@
- int audioinput = audiodevice.toUInt(&ok);
- if (ok)
- {
-+ uint idx;
- struct v4l2_audio ain;
- bzero(&ain, sizeof(ain));
- ain.index = audioinput;
-- if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) < 0)
-+
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN +
- "Unable to get audio input.");
- }
- else
- {
- ain.index = audioinput;
-- if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) < 0)
-+
-+ for (idx = 0; idx < 20; ++idx)
- {
-+ if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ {
- VERBOSE(VB_IMPORTANT, LOC_WARN +
- "Unable to set audio input.");
- }
-@@ -1036,17 +1133,26 @@
- if (deviceIsMpegFile)
- elapsedTimer.start();
- else if (_device_read_buffer)
-- _device_read_buffer->Start();
-+ {
-+ VERBOSE(VB_RECORD, LOC + "Initial startup of recorder");
-
-- needs_resolution = (driver == "hdpvr");
-+ if (StartEncoding(readfd))
-+ _device_read_buffer->Start();
-+ else
-+ {
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to start recording");
-+ recording = false;
-+ QMutexLocker locker(&recording_wait_lock);
-+ recording_wait.wakeAll();
-+ _error = true;
-+ }
-+ }
-
- QByteArray vdevice = videodevice.toAscii();
- while (encoding && !_error)
- {
- if (PauseAndWait(100))
- continue;
--
-- HandleResolutionChanges();
-
- if (deviceIsMpegFile)
- {
-@@ -1090,35 +1196,7 @@
- {
- VERBOSE(VB_IMPORTANT, LOC_ERR + "Device error detected");
-
-- _device_read_buffer->Stop();
--
-- QMutexLocker locker(&start_stop_encoding_lock);
--
-- StopEncoding(readfd);
--
-- // Make sure the next things in the file are a PAT & PMT
-- if (_stream_data->PATSingleProgram() &&
-- _stream_data->PMTSingleProgram())
-- {
-- bool tmp = _wait_for_keyframe_option;
-- _wait_for_keyframe_option = false;
-- HandleSingleProgramPAT(_stream_data->PATSingleProgram());
-- HandleSingleProgramPMT(_stream_data->PMTSingleProgram());
-- _wait_for_keyframe_option = tmp;
-- }
--
-- if (StartEncoding(readfd))
-- {
-- _device_read_buffer->Start();
-- }
-- else
-- {
-- if (0 != close(readfd))
-- VERBOSE(VB_IMPORTANT, LOC_ERR + "Close error" + ENO);
--
-- // Force card to be reopened on next iteration..
-- readfd = -1;
-- }
-+ RestartEncoding();
- }
- else if (_device_read_buffer->IsEOF())
- {
-@@ -1216,6 +1294,8 @@
- }
- }
-
-+ VERBOSE(VB_RECORD, LOC + "StartRecording finishing up");
-+
- if (_device_read_buffer)
- {
- if (_device_read_buffer->IsRunning())
-@@ -1224,6 +1304,7 @@
- delete _device_read_buffer;
- _device_read_buffer = NULL;
- }
-+
- StopEncoding(readfd);
-
- FinishRecording();
-@@ -1373,52 +1454,95 @@
-
- if (!paused)
- {
-+ VERBOSE(VB_RECORD, LOC + "PauseAndWait pause");
-+
-+ // Some drivers require streaming to be disabled before
-+ // an input switch and other channel format setting.
-+ if (requires_special_pause)
-+ StopEncoding(readfd);
-+
- if (_device_read_buffer)
- {
- QMutex drb_lock;
- drb_lock.lock();
--
- _device_read_buffer->SetRequestPause(true);
--
- pauseWait.wait(&drb_lock, timeout);
- }
- else
-- {
-- paused = true;
- pauseWait.wakeAll();
-- }
-
-- // Some drivers require streaming to be disabled before
-- // an input switch and other channel format setting.
-- if (requires_special_pause)
-- StopEncoding(readfd);
--
-+ paused = true;
- if (tvrec)
- tvrec->RecorderPaused();
- }
-
- unpauseWait.wait(&waitlock, timeout);
- }
-- if (!request_pause)
-+
-+ if (!request_pause && paused)
- {
-- if (paused)
-+ VERBOSE(VB_RECORD, LOC + "PauseAndWait unpause");
-+
-+ if (driver == "hdpvr")
- {
-- // Some drivers require streaming to be disabled before
-- // an input switch and other channel format setting.
-- if (requires_special_pause)
-- StartEncoding(readfd);
-+ m_h264_parser.Reset();
-+ _wait_for_keyframe_option = true;
-+ _seen_sps = false;
-
-- if (_device_read_buffer)
-- _device_read_buffer->SetRequestPause(false);
-+ // Sleep any less than 1.5 seconds, and the HD-PVR will
-+ // return the old resolution, when the resolution is changing.
-+ usleep(1500 * 1000);
-+ }
-
-- if (_stream_data)
-- _stream_data->Reset(_stream_data->DesiredProgram());
-- }
-+ // Some drivers require streaming to be disabled before
-+ // an input switch and other channel format setting.
-+ if (requires_special_pause)
-+ StartEncoding(readfd);
-+
-+ if (_device_read_buffer)
-+ _device_read_buffer->SetRequestPause(false);
-+
-+ if (_stream_data)
-+ _stream_data->Reset(_stream_data->DesiredProgram());
-+
- paused = false;
- }
-+
- return paused;
- }
-
-+void MpegRecorder::RestartEncoding(void)
-+{
-+ VERBOSE(VB_RECORD, LOC + "RestartEncoding");
-+
-+ _device_read_buffer->Stop();
-+
-+ QMutexLocker locker(&start_stop_encoding_lock);
-+
-+ StopEncoding(readfd);
-+
-+ // Make sure the next things in the file are a PAT & PMT
-+ if (_stream_data->PATSingleProgram() &&
-+ _stream_data->PMTSingleProgram())
-+ {
-+ _wait_for_keyframe_option = false;
-+ HandleSingleProgramPAT(_stream_data->PATSingleProgram());
-+ HandleSingleProgramPMT(_stream_data->PMTSingleProgram());
-+ }
-+
-+ if (StartEncoding(readfd))
-+ {
-+ _device_read_buffer->Start();
-+ }
-+ else
-+ {
-+ if (0 != close(readfd))
-+ VERBOSE(VB_IMPORTANT, LOC_ERR + "Close error" + ENO);
-+
-+ readfd = -1;
-+ }
-+}
-+
- bool MpegRecorder::StartEncoding(int fd)
- {
- QMutexLocker locker(&start_stop_encoding_lock);
-@@ -1427,13 +1551,22 @@
- memset(&command, 0, sizeof(struct v4l2_encoder_cmd));
- command.cmd = V4L2_ENC_CMD_START;
-
-+ if (driver == "hdpvr")
-+ HandleResolutionChanges();
-+
- VERBOSE(VB_RECORD, LOC + "StartEncoding");
-- needs_resolution = (driver == "hdpvr");
-
-- for (int idx = 0; idx < 10; ++idx)
-+ for (int idx = 0; idx < 20; ++idx)
- {
- if (ioctl(fd, VIDIOC_ENCODER_CMD, &command) == 0)
- {
-+ if (driver == "hdpvr")
-+ {
-+ m_h264_parser.Reset();
-+ _wait_for_keyframe_option = true;
-+ _seen_sps = false;
-+ }
-+
- VERBOSE(VB_RECORD, LOC + "Encoding started");
- return true;
- }
-@@ -1444,7 +1577,7 @@
- return false;
- }
-
-- usleep(250 * 1000);
-+ usleep(100 * 1000);
- }
-
- VERBOSE(VB_IMPORTANT, LOC_ERR + "StartEncoding - giving up" + ENO);
-@@ -1461,9 +1594,8 @@
-
- VERBOSE(VB_RECORD, LOC + "StopEncoding");
-
-- for (int idx = 0; idx < 10; ++idx)
-+ for (int idx = 0; idx < 20; ++idx)
- {
--
- if (ioctl(fd, VIDIOC_ENCODER_CMD, &command) == 0)
- {
- VERBOSE(VB_RECORD, LOC + "Encoding stopped");
-@@ -1476,7 +1608,7 @@
- return false;
- }
-
-- usleep(250 * 1000);
-+ usleep(100 * 1000);
- }
-
- VERBOSE(VB_IMPORTANT, LOC_ERR + "StopEncoding - giving up" + ENO);
-@@ -1544,7 +1676,7 @@
- void MpegRecorder::HandleSingleProgramPMT(ProgramMapTable *pmt)
- {
- if (!pmt)
--{
-+ {
- return;
- }
-
-@@ -1564,27 +1696,89 @@
- DTVRecorder::BufferedWrite(*(reinterpret_cast<TSPacket*>(&buf[i])));
- }
-
-+bool MpegRecorder::WaitFor_HDPVR(void)
-+{
-+ // After a resolution change, it can take the HD-PVR a few
-+ // seconds before it is usable again.
-+
-+ // Tell it to start encoding, then wait for it to actually feed us
-+ // some data.
-+ QMutexLocker locker(&start_stop_encoding_lock);
-+
-+ struct v4l2_encoder_cmd command;
-+ struct pollfd polls;
-+ int idx;
-+
-+ memset(&command, 0, sizeof(struct v4l2_encoder_cmd));
-+ command.cmd = V4L2_ENC_CMD_START;
-+
-+ for (idx = 0; idx < 20; ++idx)
-+ {
-+ if (ioctl(readfd, VIDIOC_ENCODER_CMD, &command) == 0)
-+ break;
-+ usleep(100 * 1000);
-+ }
-+
-+ if (idx == 20)
-+ return false;
-+
-+ polls.fd = readfd;
-+ polls.events = POLLIN;
-+ polls.revents = 0;
-+
-+ for (idx = 0; idx < 10; ++idx)
-+ {
-+ if (poll(&polls, 1, 250) > 0)
-+ break;
-+ }
-+
-+ if (idx == 10)
-+ return false;
-+
-+ // HD-PVR should now be "ready"
-+ command.cmd = V4L2_ENC_CMD_STOP;
-+
-+ for (idx = 0; idx < 20; ++idx)
-+ {
-+ if (ioctl(readfd, VIDIOC_ENCODER_CMD, &command) == 0)
-+ return true;
-+ usleep(100 * 1000);
-+ }
-+
-+ return false;
-+}
-+
- void MpegRecorder::HandleResolutionChanges(void)
- {
-- if (!needs_resolution)
-- return;
--
- VERBOSE(VB_RECORD, LOC + "Checking Resolution");
- struct v4l2_format vfmt;
- memset(&vfmt, 0, sizeof(vfmt));
- vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-
-+ if (driver == "hdpvr")
-+ WaitFor_HDPVR();
-+
-+ uint idx;
- uint pix = 0;
-+
-+ for (idx = 0; idx < 20; ++idx)
-+ {
- if (0 == ioctl(chanfd, VIDIOC_G_FMT, &vfmt))
- {
- VERBOSE(VB_RECORD, LOC + QString("Got Resolution %1x%2")
- .arg(vfmt.fmt.pix.width).arg(vfmt.fmt.pix.height));
- pix = vfmt.fmt.pix.width * vfmt.fmt.pix.height;
-- needs_resolution = false;
-+ break;
-+ }
-+ // Typically takes 0.9 seconds after a resolution change
-+ usleep(100 * 1000);
- }
-
- if (!pix)
-+ {
-+ VERBOSE(VB_RECORD, LOC + "Giving up detecting resolution");
- return; // nothing to do, we don't have a resolution yet
-+ }
-
- int old_max = maxbitrate, old_avg = bitrate;
- if (pix <= 768*568)
-@@ -1609,13 +1803,14 @@
- if (old_max == old_avg)
- {
- VERBOSE(VB_RECORD, LOC +
-- QString("Old bitrate %1 CBR").arg(old_avg));
-+ QString("Old bitrate %1 CBR for %2x%3")
-+ .arg(old_avg).arg(width).arg(height));
- }
- else
- {
- VERBOSE(VB_RECORD, LOC +
-- QString("Old bitrate %1/%2 VBR")
-- .arg(old_avg).arg(old_max));
-+ QString("Old bitrate %1/%2 VBR for %3x%4")
-+ .arg(old_avg).arg(old_max).arg(width).arg(height));
- }
-
- if (maxbitrate == bitrate)
-@@ -1642,12 +1837,6 @@
- maxbitrate * 1000);
-
- set_ctrls(readfd, ext_ctrls);
-+
- }
--
-- // Restart streaming. Shouldn't be needed? seems to be with current driver.
-- QMutexLocker locker(&start_stop_encoding_lock);
-- StopEncoding(readfd);
-- StartEncoding(readfd);
--
-- needs_resolution = false;
- }
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mythcommflag-avidemux.2.patch b/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mythcommflag-avidemux.2.patch
deleted file mode 100644
index d26645f..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/mythcommflag-avidemux.2.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-Index: programs/mythcommflag/main.cpp
-===================================================================
---- programs/mythcommflag/main.cpp (revision 18596)
-+++ programs/mythcommflag/main.cpp (working copy)
-@@ -300,6 +300,132 @@
- return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS;
- }
-
-+int GetAviDemux(QString list, QString chanid, QString starttime, const QString &outputfilename)
-+{
-+ QMap<long long, int> cutlist;
-+ QMap<long long, int>::Iterator it;
-+ QString result;
-+ int startValue = 0;
-+ long long myTotalFrames;
-+ long long myFrameRate;
-+
-+ ProgramInfo *pginfo =
-+ ProgramInfo::GetProgramFromRecorded(chanid, starttime);
-+
-+ NuppelVideoPlayer* nvp = new NuppelVideoPlayer("avidemux_export", pginfo);
-+
-+ myFrameRate = (long long)(nvp->GetFrameRate() * 1000);
-+ myTotalFrames = 1000000; //nvp->GetTotalFrameCount();
-+
-+ if (!pginfo)
-+ {
-+ VERBOSE(VB_IMPORTANT,
-+ QString("No program data exists for channel %1 at %2")
-+ .arg(chanid).arg(starttime));
-+ return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA;
-+ }
-+
-+ QString filename = pginfo->GetPlaybackURL(TRUE);
-+
-+ if (list == "cutlist")
-+ pginfo->GetCutList(cutlist);
-+ else
-+ pginfo->GetCommBreakList(cutlist);
-+
-+// Formatting of output data
-+
-+ for (it = cutlist.begin(); it != cutlist.end(); ++it)
-+ {
-+ if ((it.key() == 0) && (startValue == 0)) // Cutlist starts on first frame,
-+ {
-+ ++it;
-+ startValue = it.key();
-+ }
-+
-+ if ((it.key() != 0) && (startValue == 0)) // Cutlist starts on non-first frame
-+ {
-+ result += QString("app.addSegment(0,0,%1);").arg(it.key());
-+ startValue = it.key();
-+ }
-+ else
-+ {
-+ if ((*it == MARK_COMM_END) && (startValue != 0) ||
-+ (*it == MARK_CUT_END) && (startValue != 0))
-+ {
-+ if (result != "")
-+ result += "\n";
-+ startValue = it.key();
-+ result += QString("app.addSegment(0,%1,").arg(it.key()); // Value is a start value
-+ }
-+ else
-+ {
-+ result += QString("%1);").arg(it.key() - startValue); // Value is an end value
-+ }
-+ }
-+ }
-+
-+if (it.key() != myTotalFrames)
-+ {
-+ result += QString("%1);").arg(myTotalFrames);
-+ }
-+
-+// Governs the file output:
-+
-+ QString tmp = "";
-+ ostream *out = &cout;
-+
-+ if (outputfilename != "-"){
-+ QByteArray tmp = outputfilename.toLocal8Bit();
-+ out = new fstream(tmp.constData(), ios::app | ios::out );
-+ }
-+
-+ if (outputfilename == ""){
-+ VERBOSE(VB_IMPORTANT,
-+ QString("Error: AVIDemux output requires the use of the --outputfile option."));
-+ return COMMFLAG_EXIT_INVALID_CMDLINE;
-+ }
-+
-+ tmp = QString("//AD <- Needed to identify//\n"
-+ "//--automatically built--\n"
-+ "//--Project:\n\n"
-+ "var app = new Avidemux();\n\n"
-+ "//** Video **\n"
-+ "// 01 videos source\n"
-+ "app.load(\"%1\");\n\n"
-+ "app.clearSegments();\n\n"
-+ "%2\n"
-+ "app.markerA=0;\n"
-+ "app.markerB=%3;\n"
-+ "app.rebuildIndex();\n\n"
-+ "//** Postproc **\n"
-+ "app.video.setPostProc(3,3,0);\n\n"
-+ "app.video.setFps1000(%4);\n\n"
-+ "//** Filters **\n\n"
-+ "//** Video Codec conf **\n"
-+ "app.video.codec(\"Copy\",\"CQ=4\",\"0 \");\n\n"
-+ "//** Audio **\n"
-+ "app.audio.reset();\n"
-+ "app.audio.codec(\"copy\",128,0,\"\");\n"
-+ "app.audio.normalizeMode=0;\n"
-+ "app.audio.normalizeValue=0;\n"
-+ "app.audio.delay=0;\n"
-+ "app.audio.mixer(\"NONE\");\n"
-+ "app.setContainer(\"AVI\");\n"
-+ "setSuccess(1);\n"
-+ "//app.Exit();\n\n"
-+ "//End of script\n").arg(filename).arg(result).arg(myTotalFrames).arg(myFrameRate).toLocal8Bit().constData();
-+
-+ const QByteArray tmp2 = tmp.toLocal8Bit();
-+ *out << tmp2.constData() << endl;
-+
-+ VERBOSE(VB_IMPORTANT,
-+ QString("AVIDemux Project generated for %1 at %2 with filename %3.")
-+ .arg(chanid).arg(starttime).arg(outputfilename));
-+
-+ return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS;
-+}
-+
-+
- void streamOutCommercialBreakList(
- ostream &output, const QMap<long long, int> &commercialBreakList)
- {
-@@ -811,6 +937,8 @@
- bool clearCutlist = false;
- bool getCutlist = false;
- bool getSkipList = false;
-+ bool getAviDemuxCutlist = false;
-+ bool getAviDemuxSkiplist = false;
- QString newCutList = QString::null;
- QMap<QString, QString> settingsOverride;
-
-@@ -960,6 +1088,10 @@
- getCutlist = true;
- else if (!strcmp(a.argv()[argpos], "--getskiplist"))
- getSkipList = true;
-+ else if (!strcmp(a.argv()[argpos], "--getcutlist-avidemux"))
-+ getAviDemuxCutlist = true;
-+ else if (!strcmp(a.argv()[argpos], "--getskiplist-avidemux"))
-+ getAviDemuxSkiplist = true;
- else if (!strcmp(a.argv()[argpos], "--setcutlist"))
- newCutList = (a.argv()[++argpos]);
- else if (!strcmp(a.argv()[argpos], "-j"))
-@@ -1111,6 +1243,8 @@
- " #-#[,#-#]... (ie, 1-100,1520-3012,4091-5094\n"
- "--getcutlist Display the current cutlist\n"
- "--getskiplist Display the current Commercial Skip list\n"
-+ "--getcutlist-avidemux Export cutlist as AVIDemux Project File\n"
-+ "--getskiplist-avidemux Export skiplist as AVIDemux Project File\n"
- "-v or --verbose debug-level Use '-v help' for level info\n"
- "--queue Insert flagging job into the JobQueue rather than\n"
- " running flagging in the foreground\n"
-@@ -1223,6 +1357,12 @@
- if (!newCutList.isNull())
- return SetCutList(chanid, starttime, newCutList);
-
-+ if (getAviDemuxCutlist)
-+ return GetAviDemux("cutlist", chanid, starttime, outputfilename);
-+
-+ if (getAviDemuxSkiplist)
-+ return GetAviDemux("commflag", chanid, starttime, outputfilename);
-+
- if (getCutlist)
- return GetMarkupList("cutlist", chanid, starttime);
-
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/DeviceReadBuffer-polltimeout.2.patch b/abs/core-testing/mythtv/trunk/mythtv/DeviceReadBuffer-polltimeout.2.patch
index 5bb713f..5bb713f 100644
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/DeviceReadBuffer-polltimeout.2.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/DeviceReadBuffer-polltimeout.2.patch
diff --git a/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD b/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD
new file mode 100755
index 0000000..d5560bd
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD
@@ -0,0 +1,76 @@
+pkgname=mythtv-svn
+pkgver=19295
+pkgrel=1
+pkgdesc="A personal video recorder for Linux"
+url="http://www.mythtv.org"
+license="GPL"
+depends=('lame' 'libmysqlclient' 'alsa-lib' 'wget' 'qt' 'x-server' 'freetype2' 'libmpeg2' 'libxml2' 'libraw1394' 'lirc' 'perl-date-manip' 'libavc1394' 'libdc1394' 'libiec61883')
+makedepends=('subversion')
+conflicts=(mythtv)
+replaces=()
+backup=()
+options=(!strip)
+MAKEFLAGS="-j6"
+install='mythtv.install'
+
+patchs=('svn_main_menu_popup.patch' 'smolt_jump.patch' 'DeviceReadBuffer-polltimeout.2.patch' 'mpegrecorder-hdpvr-v2a.patch' 'hdpvr-livetv.patch')
+source=('mythbackend' 'myth.sh' `echo ${patchs[@]:0}` )
+arch=('i686')
+md5sums=()
+
+_svntrunk=http://cvs.mythtv.org/svn/trunk/mythtv
+_svnmod=mythtv
+
+build() {
+
+# svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
+ svn co $_svntrunk $_svnmod
+ cd $startdir/src/mythtv
+
+ echo "--------------------------applying patches----------------------------------------------------"
+ for i in `echo ${patchs[@]:0} `
+ do
+ echo applying $i
+ echo "-----------------------------"
+ patch -Np0 -i ${startdir}/src/$i #|| return 1
+ done
+ echo "--------------------------done applying patches-----------------------------------------------"
+
+ sed -i -e "s/\`(svnversion \$\${SVNTREEDIR} 2>\/dev\/null) || echo Unknown\`/$pkgver/" version.pro
+ make distclean
+
+ # configure
+ ./configure --prefix=/usr --cpu=${ARCH} \
+ --enable-vdpau --enable-xvmc --enable-xvmc-pro \
+ --enable-opengl-vsync --enable-libfaad --enable-dvb --enable-firewire \
+ --compile-type=release --with-bindings=perl,python \
+ --enable-audio-alsa --disable-audio-jack --disable-audio-arts || return 1
+
+ # build and install
+ . /etc/profile
+ make || return 1
+ make INSTALL_ROOT=$startdir/pkg install || return 1
+
+ # install db schema, scripts and docs
+ install -m0644 database/mc.sql $startdir/pkg/usr/share/mythtv/ || return 1
+ install -D -m0755 ../mythbackend $startdir/pkg/etc/rc.d/mythbackend || return 1
+ cp -r docs $startdir/pkg/usr/share/mythtv/ || return 1
+ # cp ../QUICKSTART.archlinux $startdir/pkg/usr/share/mythtv/ || return 1
+
+ # install contrib
+ mkdir -p $startdir/pkg/usr/share/mythtv/contrib || return 1
+ install -m0755 contrib/* $startdir/pkg/usr/share/mythtv/contrib
+
+ # patch the xml LinHES style
+ cp -r $startdir/menu-xml/*.xml $startdir/pkg/usr/share/mythtv
+ cd $startdir/pkg/usr/share/mythtv
+ patch -p0 < $startdir/menu-xml/mainmenu.xml.patch
+ patch -p0 < $startdir/menu-xml/optical_menu.xml.patch
+ patch -p0 < $startdir/menu-xml/library.xml.patch
+ patch -p0 < $startdir/menu-xml/util_menu.xml.patch
+
+ # make log dir
+ mkdir -p $startdir/pkg/var/log/mythtv
+ chown 1000.1000 $startdir/pkg/var/log/mythtv
+
+}
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/aacdecoder.cpp.patch b/abs/core-testing/mythtv/trunk/mythtv/aacdecoder.cpp.patch
index 8796eb4..8796eb4 100644
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/patches/aacdecoder.cpp.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/aacdecoder.cpp.patch
diff --git a/abs/core-testing/mythtv/trunk/mythtv/compile_mythtv.sh b/abs/core-testing/mythtv/trunk/mythtv/compile_mythtv.sh
new file mode 100755
index 0000000..ca457e3
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/compile_mythtv.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+# compile_mythtv.sh
+# rev 0.5 - 1Nov2008
+#
+# This script will compile and install MythTV
+#
+
+PKG_MAINTAINER=nharris@eoimaging.com
+echo PKG_MAINTAINER is set to $PKG_MAINTAINER
+
+PKG_VER=0.22-svn`date +%Y%m%d`
+echo PKG_VER is set to $PKG_VER
+
+cd src/mythtv-trunk
+
+#
+# compile mythtv
+#
+echo Compiling mythtv
+cd mythtv
+export QTDIR=/usr/share/qt
+./configure --enable-opengl-vsync --cpu=i686 --enable-vdpau --enable-opengl-vsync --enable-libfaad --prefix=/usr
+#./configure --cpu=i686 --enable-dvb --enable-xvmc --enable-opengl-vsync --enable-xvmc-pro --enable-libfaad --prefix=/usr
+qmake mythtv.pro
+make || return 1
+
+#
+# install mythtv
+#
+#echo "MythTV 0.22 SVN build" > description-pak
+#checkinstall -D --default --pkgname mythtv --pkgversion $PKG_VER --maintainer $PKG_MAINTAINER
+#mv myth*.deb ../..
+sudo make install
+cd ..
+
+#
+# compile mythplugins
+#
+echo Compiling mythplugings
+cd mythplugins
+./configure --enable-all --cpu=i686 --prefix=/usr
+qmake mythplugins.pro
+make || return 1
+
+#
+# install mythplugins
+#
+#echo "MythTV 0.22 SVN build" > description-pak
+#checkinstall -D --default --pkgname mythplugins --pkgversion $PKG_VER --maintainer $PKG_MAINTAINER
+#mv myth*.deb ../..
+sudo make install
+cd ..
+
+#
+# compile myththemes
+#
+echo Compiling myththemes
+cd myththemes
+./configure --prefix=/usr
+qmake myththemes.pro
+make || return 1
+
+#
+# install myththemes
+#
+#echo "MythTV 0.22 SVN build" > description-pak
+#checkinstall -D --default --pkgname myththemes --pkgversion $PKG_VER --maintainer $PKG_MAINTAINER
+#mv myth*.deb ../..
+sudo make install
+cd ..
+
+#
+# compile additional themes
+#
+echo Compiling additional themes
+cd themes
+./configure --prefix=/usr
+qmake themes.pro
+make || return 1
+
+#
+# install additional themes
+#
+#echo "MythTV 0.22 SVN build" > description-pak
+#checkinstall -D --default --pkgname mythtv-themes --pkgversion $PKG_VER --maintainer $PKG_MAINTAINER
+#mv myth*.deb ../..
+sudo make install
+cd ..
+
+#
+# update mythweb
+#
+cd mythplugins/mythweb
+sudo cp -R * /data/srv/httpd/htdocs/mythweb
+sudo chown -R http:users /data/srv/httpd/htdocs/mythweb
+cd ../..
+
+echo "DONE!"
+
diff --git a/abs/core-testing/mythtv/trunk/mythtv/get_mythtv.sh b/abs/core-testing/mythtv/trunk/mythtv/get_mythtv.sh
new file mode 100755
index 0000000..c01ccf1
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/get_mythtv.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+# get_mythtv.sh
+# rev 0.5 - 1Nov2008
+BUILD_DIR=/home/nharris/mythtv
+
+cd $BUILD_DIR
+
+#
+# get the latest from SVN
+#
+if [ -d src ]
+then
+ cd src
+else
+ mkdir src
+ cd src
+fi
+
+if [ -d mythtv-trunk ]
+then
+ echo Updating mythtv from svn.
+ cd mythtv-trunk
+ cd mythtv
+ svn update
+ make clean
+ cd ../mythplugins
+ svn update
+ make clean
+ cd ../myththemes
+ svn update
+ make clean
+ cd ../themes
+ svn update
+ make clean
+ cd ..
+else
+ echo Creating mythtv from svn.
+ mkdir mythtv-trunk
+ cd mythtv-trunk
+ svn co http://svn.mythtv.org/svn/trunk/mythtv
+ svn co http://svn.mythtv.org/svn/trunk/mythplugins
+ svn co http://svn.mythtv.org/svn/trunk/myththemes
+ svn co http://svn.mythtv.org/svn/trunk/themes
+fi
+
+#
+# install patches
+#
+MYTH_PATCHES=$BUILD_DIR/patches
+cd $BUILD_DIR/src/mythtv-trunk/mythtv
+
+# HD-PVR support
+patch -p0 < $MYTH_PATCHES/DeviceReadBuffer-polltimeout.2.patch
+patch -p0 < $MYTH_PATCHES/mpegrecorder-hdpvr-v2a.patch
+patch -p0 < $MYTH_PATCHES/hdpvr-livetv.patch
+
+# LinHES popup menu
+patch -p0 < $MYTH_PATCHES/svn_main_menu_popup.patch
+
+# Arch build fix
+cd $BUILD_DIR/src/mythtv-trunk/mythplugins
+patch -p0 < $MYTH_PATCHES/aacdecoder.cpp.patch
+
+# Patch the xml LinHES style
+MENU_DIR=$BUILD_DIR/menu-xml
+MYTH_DIR=$BUILD_DIR/src/mythtv-trunk/mythtv/programs/mythfrontend
+cp $MENU_DIR/*.xml $MYTH_DIR
+cd $MYTH_DIR
+patch -p0 < $MENU_DIR/mainmenu.xml.patch
+patch -p0 < $MENU_DIR/optical_menu.xml.patch
+patch -p0 < $MENU_DIR/library.xml.patch
+
+#
+# END
+#
+cd $BUILD_DIR
+echo "DONE!"
diff --git a/abs/core-testing/mythtv/trunk/mythtv/hdpvr-livetv.patch b/abs/core-testing/mythtv/trunk/mythtv/hdpvr-livetv.patch
new file mode 100644
index 0000000..6297ae1
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/hdpvr-livetv.patch
@@ -0,0 +1,109 @@
+Index: libs/libmythtv/mpegrecorder.cpp
+===================================================================
+--- libs/libmythtv/mpegrecorder.cpp.orig
++++ libs/libmythtv/mpegrecorder.cpp
+@@ -1109,6 +1109,14 @@ void MpegRecorder::StartRecording(void)
+
+ if (driver == "hdpvr")
+ {
++ if (curRecording->recgroup == "LiveTV")
++ {
++ // Don't bother checking resolution, always use best bitrate
++ int maxbitrate = std::max(high_mpeg4peakbitrate,
++ high_mpeg4avgbitrate);
++ SetBitrate(high_mpeg4avgbitrate, maxbitrate, "LiveTV");
++ }
++
+ int progNum = 1;
+ MPEGStreamData *sd = new MPEGStreamData(progNum, true);
+ sd->SetRecordingType(_recording_type);
+@@ -1553,7 +1561,7 @@ bool MpegRecorder::StartEncoding(int fd)
+ memset(&command, 0, sizeof(struct v4l2_encoder_cmd));
+ command.cmd = V4L2_ENC_CMD_START;
+
+- if (driver == "hdpvr")
++ if (driver == "hdpvr" && curRecording->recgroup != "LiveTV")
+ HandleResolutionChanges();
+
+ VERBOSE(VB_RECORD, LOC + "StartEncoding");
+@@ -1755,6 +1763,35 @@ bool MpegRecorder::WaitFor_HDPVR(void)
+ return false;
+ }
+
++void MpegRecorder::SetBitrate(int bitrate, int maxbitrate,
++ const QString & reason)
++{
++ if (maxbitrate == bitrate)
++ {
++ VERBOSE(VB_RECORD, LOC + QString("%1 bitrate %2 kbps CBR")
++ .arg(reason).arg(bitrate));
++ }
++ else
++ {
++ VERBOSE(VB_RECORD, LOC + QString("%1 bitrate %2/%3 kbps VBR")
++ .arg(reason).arg(bitrate).arg(maxbitrate));
++ }
++
++ vector<struct v4l2_ext_control> ext_ctrls;
++ add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
++ (maxbitrate == bitrate) ?
++ V4L2_MPEG_VIDEO_BITRATE_MODE_CBR :
++ V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
++
++ add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE,
++ bitrate * 1000);
++
++ add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_PEAK,
++ maxbitrate * 1000);
++
++ set_ctrls(readfd, ext_ctrls);
++}
++
+ void MpegRecorder::HandleResolutionChanges(void)
+ {
+ VERBOSE(VB_RECORD, LOC + "Checking Resolution");
+@@ -1819,30 +1856,7 @@ void MpegRecorder::HandleResolutionChang
+ .arg(old_avg).arg(old_max));
+ }
+
+- if (maxbitrate == bitrate)
+- {
+- VERBOSE(VB_RECORD, LOC + QString("New bitrate %1 kbps CBR")
+- .arg(bitrate));
+- }
+- else
+- {
+- VERBOSE(VB_RECORD, LOC + QString("New bitrate %1/%2 kbps VBR")
+- .arg(bitrate).arg(maxbitrate));
+- }
+-
+- vector<struct v4l2_ext_control> ext_ctrls;
+- add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
+- (maxbitrate == bitrate) ?
+- V4L2_MPEG_VIDEO_BITRATE_MODE_CBR :
+- V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
+-
+- add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE,
+- bitrate * 1000);
+-
+- add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_PEAK,
+- maxbitrate * 1000);
+-
+- set_ctrls(readfd, ext_ctrls);
+-
++ SetBitrate(bitrate, maxbitrate, "New");
+ }
+ }
++
+Index: libs/libmythtv/mpegrecorder.h
+===================================================================
+--- libs/libmythtv/mpegrecorder.h.orig
++++ libs/libmythtv/mpegrecorder.h
+@@ -87,6 +87,7 @@ class MpegRecorder : public DTVRecorder,
+ void ResetForNewFile(void);
+
+ bool WaitFor_HDPVR(void);
++ void SetBitrate(int bitrate, int maxbitrate, const QString & reason);
+ void HandleResolutionChanges(void);
+
+ inline bool CheckCC(uint pid, uint cc);
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/HOST_SETTINGS.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/HOST_SETTINGS.xml
index f257920..f257920 100644..100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/HOST_SETTINGS.xml
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/HOST_SETTINGS.xml
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/is.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/is.xml
new file mode 100755
index 0000000..88b7e6b
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/is.xml
@@ -0,0 +1,3 @@
+<mythmenu name="Internet Steams">
+
+</mythmenu>
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/library.xml.patch b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/library.xml.patch
new file mode 100755
index 0000000..02df082
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/library.xml.patch
@@ -0,0 +1,13 @@
+--- library.xml.orig 2008-08-31 03:27:59.000000000 +0000
++++ library.xml 2009-01-26 15:04:16.000000000 +0000
+@@ -121,8 +121,8 @@
+ <type>STREAM</type>
+ <text>Play online streams</text>
+ <text lang="HE">נגן מדיה מכוונת</text>
+- <action>PLUGIN mythstream</action>
+- <depends>mythstream</depends>
++ <text>Online Streams</text>
++ <action>MENU is.xml</action>
+ </button>
+
+ <button>
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/linhes.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/linhes.xml
new file mode 100755
index 0000000..8bc929f
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/linhes.xml
@@ -0,0 +1,54 @@
+<mythmenu name="LinHES">
+
+ <button>
+ <type>SETUP_GENERAL</type>
+ <text>MythTV Configuration</text>
+ <text lang="IT">Impostazioni</text>
+ <text lang="ES">Configuración</text>
+ <text lang="CA">Configurar</text>
+ <text lang="FR">paramètres</text>
+ <text lang="DE">Zubehör / Konfiguration</text>
+ <text lang="DK">Tilbehør/Indstillinger</text>
+ <text lang="IS">Uppsetning</text>
+ <text lang="NL">Configuratie</text>
+ <text lang="PT">Utensílios</text>
+ <text lang="SV">Verktyg / Inställningar</text>
+ <text lang="JA">設定</text>
+ <text lang="FI">Oheis/Asetukset</text>
+ <text lang="ZH_TW">工具/設定</text>
+ <text lang="SI">Nastavitve</text>
+ <text lang="ET">Utiliidid / sätted</text>
+ <text lang="NB">Verktøy/Oppsett</text>
+ <text lang="CZ">Pomůcky</text>
+ <text lang="RU">Утилиты / Настройки</text>
+ <text lang="AR">تضبيطات</text>
+ <text lang="PL">Narzędzia / ustawienia</text>
+ <text lang="HE">עזרים / הגדרות</text>
+ <alttext lang="DE">Verschiedenes</alttext>
+ <alttext lang="SV">Inställningar</alttext>
+ <alttext lang="ET">Sätted</alttext>
+ <alttext lang="RU">Настройки</alttext>
+ <alttext lang="AR">تضبيطات</alttext>
+ <action>MENU util_menu.xml</action>
+ </button>
+
+ <button>
+ <type>LINHES_SETUP</type>
+ <text>LinHES Configuration</text>
+ <action>MENU HOST_SETTINGS.xml</action>
+ </button>
+
+ <button>
+ <type>BACKUP</type>
+ <text>Backup LinHES</text>
+ <action>MENU mythbackup.xml</action>
+ </button>
+
+ <button>
+ <type>RESTORE</type>
+ <text>Restore LinHES</text>
+ <action>MENU mythrestore.xml</action>
+ </button>
+
+</mythmenu>
+
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mainmenu.xml.patch b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mainmenu.xml.patch
new file mode 100755
index 0000000..a299325
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mainmenu.xml.patch
@@ -0,0 +1,39 @@
+--- mainmenu.xml.orig 2009-01-09 02:45:07.000000000 +0000
++++ mainmenu.xml 2009-01-22 08:04:28.000000000 +0000
+@@ -158,34 +158,8 @@
+
+ <button>
+ <type>MENU_UTILITIES_SETUP</type>
+- <text>Utilities / Setup</text>
+- <text lang="IT">Impostazioni</text>
+- <text lang="ES">Configuración</text>
+- <text lang="CA">Configurar</text>
+- <text lang="FR">paramètres</text>
+- <text lang="DE">Zubehör / Konfiguration</text>
+- <text lang="DK">Tilbehør/Indstillinger</text>
+- <text lang="IS">Uppsetning</text>
+- <text lang="NL">Configuratie</text>
+- <text lang="PT">Utensílios</text>
+- <text lang="SV">Verktyg / Inställningar</text>
+- <text lang="JA">設定</text>
+- <text lang="FI">Oheis/Asetukset</text>
+- <text lang="ZH_TW">工具/設定</text>
+- <text lang="SI">Nastavitve</text>
+- <text lang="ET">Utiliidid / sätted</text>
+- <text lang="NB">Verktøy/Oppsett</text>
+- <text lang="CZ">Pomůcky</text>
+- <text lang="RU">Утилиты / Настройки</text>
+- <text lang="AR">تضبيطات</text>
+- <text lang="PL">Narzędzia / ustawienia</text>
+- <text lang="HE">עזרים / הגדרות</text>
+- <alttext lang="DE">Verschiedenes</alttext>
+- <alttext lang="SV">Inställningar</alttext>
+- <alttext lang="ET">Sätted</alttext>
+- <alttext lang="RU">Настройки</alttext>
+- <alttext lang="AR">تضبيطات</alttext>
+- <action>MENU util_menu.xml</action>
++ <text>Service Menu</text>
++ <action>MENU linhes.xml</action>
+ </button>
+
+ <!-- <button>
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythbackup.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythbackup.xml
new file mode 100755
index 0000000..656860d
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythbackup.xml
@@ -0,0 +1,20 @@
+<mythmenu name="LinHES">
+
+ <button>
+ <type>BACKUP</type>
+ <text>Do you wish to backup?</text>
+ <action>NONE</action>
+ </button>
+
+ <button>
+ <type>BACKUP</type>
+ <text>Yes</text>
+ <action>EXEC sudo /usr/LH/bin/mythbackup</action>
+ </button>
+
+ <button>
+ <type>BACKUP</type>
+ <text>No</text>
+ <action>MENU linhes.xml</action>
+ </button>
+</mythmenu>
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythrestore.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythrestore.xml
new file mode 100755
index 0000000..05cb0a7
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/mythrestore.xml
@@ -0,0 +1,20 @@
+<mythmenu name="LinHES">
+
+ <button>
+ <type>RESTORE</type>
+ <text>Do you wish to restore?</text>
+ <action>NONE</action>
+ </button>
+
+ <button>
+ <type>RESTORE</type>
+ <text>Yes</text>
+ <action>EXEC sudo /usr/LH/bin/mythrestore</action>
+ </button>
+
+ <button>
+ <type>BACKUP</type>
+ <text>No</text>
+ <action>MENU linhes.xml</action>
+ </button>
+</mythmenu>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/optical_menu.xml.patch b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/optical_menu.xml.patch
index 7e016a5..d1cb70c 100644..100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/optical_menu.xml.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/optical_menu.xml.patch
@@ -1,12 +1,12 @@
---- optical_menu.xml.orig 2008-11-19 11:52:44.000000000 -0500
-+++ optical_menu.xml 2008-11-19 12:32:19.000000000 -0500
+--- optical_menu.xml.orig 2008-10-02 22:46:30.000000000 +0000
++++ optical_menu.xml 2008-07-02 04:05:15.000000000 +0000
@@ -129,6 +129,12 @@
</button>
<button>
+ <type>DVD_RIP</type>
+ <text>Import video files from DVD</text>
-+ <action>EXEC /usr/local/bin/importfiles.sh</action>
++ <action>EXEC /usr/LH/bin/importfiles.sh</action>
+ </button>
+
+ <button>
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/original/create_patch.sh b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/original/create_patch.sh
new file mode 100755
index 0000000..34d8b8c
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/original/create_patch.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+for i in *.xml
+do
+ diff -u $i.orig $i > ../$i.patch
+done
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/setup.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/setup.xml
index f56bb6f..f56bb6f 100644..100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/setup.xml
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/setup.xml
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/siriusmenu.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/siriusmenu.xml
index e317b36..e317b36 100644..100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/siriusmenu.xml
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/siriusmenu.xml
diff --git a/abs/core-testing/mythtv/trunk/mythtv/menu-xml/util_menu.xml.patch b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/util_menu.xml.patch
new file mode 100755
index 0000000..26ac863
--- /dev/null
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/util_menu.xml.patch
@@ -0,0 +1,17 @@
+--- util_menu.xml.orig 2009-01-09 02:45:07.000000000 +0000
++++ util_menu.xml 2009-01-22 08:04:28.000000000 +0000
+@@ -76,7 +76,13 @@
+ <action>PLUGIN mythcontrols</action>
+ <depends>mythcontrols</depends>
+ </button>
+-
++
++ <button>
++ <type>VIDEO_SCREENSHOOTER</type>
++ <text>Thumbnail Generator</text>
++ <action>EXEC /usr/LH/bin/shootscreens-mythtv.sh</action>
++ </button>
++
+ <button>
+ <type>SETUP_MENU</type>
+ <text>Setup</text>
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/xmmenu.xml b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/xmmenu.xml
index 6b26d11..6b26d11 100644..100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/menu-xml/xmmenu.xml
+++ b/abs/core-testing/mythtv/trunk/mythtv/menu-xml/xmmenu.xml
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/mpegrecorder-hdpvr-v1.1.patch b/abs/core-testing/mythtv/trunk/mythtv/mpegrecorder-hdpvr-v2a.patch
index f292b7f..dbef933 100644
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/mpegrecorder-hdpvr-v1.1.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/mpegrecorder-hdpvr-v2a.patch
@@ -1,43 +1,45 @@
-Index: libs/libmythtv/mpegrecorder.h
+Index: libs/libmythtv/DeviceReadBuffer.cpp
===================================================================
---- libs/libmythtv/mpegrecorder.h (revision 19056)
-+++ libs/libmythtv/mpegrecorder.h (working copy)
-@@ -80,11 +80,13 @@
- uint GetFilteredAudioLayer(void) const;
- uint GetFilteredAudioBitRate(uint audio_layer) const;
-
-+ void RestartEncoding(void);
- bool StartEncoding(int fd);
- bool StopEncoding(int fd);
-
- void ResetForNewFile(void);
-
-+ bool WaitFor_HDPVR(void);
- void HandleResolutionChanges(void);
+--- libs/libmythtv/DeviceReadBuffer.cpp.orig
++++ libs/libmythtv/DeviceReadBuffer.cpp
+@@ -169,7 +169,17 @@ bool DeviceReadBuffer::IsPaused(void) co
+ return paused;
+ }
- inline bool CheckCC(uint pid, uint cc);
-@@ -104,7 +106,6 @@
- // State
- bool recording;
- bool encoding;
-- bool needs_resolution;
- mutable QMutex start_stop_encoding_lock;
- QMutex recording_wait_lock;
- QWaitCondition recording_wait;
-@@ -113,7 +114,7 @@
- bool cleartimeonpause;
+-bool DeviceReadBuffer::WaitForUnpause(int timeout)
++bool DeviceReadBuffer::WaitForPaused(unsigned long timeout)
++{
++ QMutexLocker locker(&lock);
++
++ if (!paused)
++ pauseWait.wait(&lock, timeout);
++
++ return paused;
++}
++
++bool DeviceReadBuffer::WaitForUnpause(unsigned long timeout)
+ {
+ QMutexLocker locker(&lock);
- // Encoding info
-- int width, height;
-+ uint width, height;
- int bitrate, maxbitrate, streamtype, aspectratio;
- int audtype, audsamplerate, audbitratel1, audbitratel2, audbitratel3;
- int audvolume;
+Index: libs/libmythtv/DeviceReadBuffer.h
+===================================================================
+--- libs/libmythtv/DeviceReadBuffer.h.orig
++++ libs/libmythtv/DeviceReadBuffer.h
+@@ -42,7 +42,8 @@ class DeviceReadBuffer
+
+ void SetRequestPause(bool request);
+ bool IsPaused(void) const;
+- bool WaitForUnpause(int timeout);
++ bool WaitForUnpause(unsigned long timeout);
++ bool WaitForPaused(unsigned long timeout);
+
+ bool IsErrored(void) const { return error; }
+ bool IsEOF(void) const { return eof; }
Index: libs/libmythtv/mpegrecorder.cpp
===================================================================
---- libs/libmythtv/mpegrecorder.cpp (revision 19056)
-+++ libs/libmythtv/mpegrecorder.cpp (working copy)
-@@ -19,6 +19,7 @@
+--- libs/libmythtv/mpegrecorder.cpp.orig
++++ libs/libmythtv/mpegrecorder.cpp
+@@ -19,6 +19,7 @@ using namespace std;
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
@@ -45,16 +47,16 @@ Index: libs/libmythtv/mpegrecorder.cpp
// avlib headers
extern "C" {
-@@ -86,7 +87,7 @@
+@@ -86,7 +87,7 @@ MpegRecorder::MpegRecorder(TVRec *rec) :
requires_special_pause(false),
// State
- recording(false), encoding(false),
-- needs_resolution(false), start_stop_encoding_lock(QMutex::Recursive),
+ recording(false), encoding(false),
+- needs_resolution(false), start_stop_encoding_lock(QMutex::Recursive),
+ start_stop_encoding_lock(QMutex::Recursive),
- recording_wait_lock(), recording_wait(),
+ recording_wait_lock(), recording_wait(),
// Pausing state
cleartimeonpause(false),
-@@ -487,13 +488,21 @@
+@@ -493,12 +494,20 @@ bool MpegRecorder::OpenV4L2DeviceAsInput
bool MpegRecorder::SetFormat(int chanfd)
{
@@ -66,35 +68,33 @@ Index: libs/libmythtv/mpegrecorder.cpp
- if (ioctl(chanfd, VIDIOC_G_FMT, &vfmt) < 0)
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_G_FMT, &vfmt) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 10)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_ERR + "Error getting format" + ENO);
return false;
- }
-@@ -501,8 +510,15 @@
+@@ -507,7 +516,14 @@ bool MpegRecorder::SetFormat(int chanfd)
vfmt.fmt.pix.width = width;
vfmt.fmt.pix.height = height;
- if (ioctl(chanfd, VIDIOC_S_FMT, &vfmt) < 0)
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_S_FMT, &vfmt) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_ERR + "Error setting format" + ENO);
return false;
- }
-@@ -513,10 +529,19 @@
+@@ -519,9 +535,18 @@ bool MpegRecorder::SetFormat(int chanfd)
/// Set audio language mode
bool MpegRecorder::SetLanguageMode(int chanfd)
{
@@ -104,35 +104,33 @@ Index: libs/libmythtv/mpegrecorder.cpp
- if (ioctl(chanfd, VIDIOC_G_TUNER, &vt) < 0)
+
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_G_TUNER, &vt) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN + "Unable to get audio mode" + ENO);
return false;
- }
-@@ -549,8 +574,15 @@
+@@ -555,7 +580,14 @@ bool MpegRecorder::SetLanguageMode(int c
success = false;
}
- if (ioctl(chanfd, VIDIOC_S_TUNER, &vt) < 0)
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_S_TUNER, &vt) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN + "Unable to set audio mode" + ENO);
success = false;
- }
-@@ -561,10 +593,19 @@
+@@ -567,9 +599,18 @@ bool MpegRecorder::SetLanguageMode(int c
bool MpegRecorder::SetRecordingVolume(int chanfd)
{
// Get volume min/max values
@@ -142,35 +140,33 @@ Index: libs/libmythtv/mpegrecorder.cpp
- if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) < 0)
+
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_QUERYCTRL, &qctrl) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN +
"Unable to get recording volume parameters(max/min)" + ENO +
- "\n\t\t\tusing default range [0,65535].");
-@@ -582,8 +623,15 @@
+@@ -588,7 +629,14 @@ bool MpegRecorder::SetRecordingVolume(in
ctrl.id = V4L2_CID_AUDIO_VOLUME;
ctrl.value = ctrl_volume;
- if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) < 0)
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN +
"Unable to set recording volume" + ENO + "\n\t\t\t" +
- "If you are using an AverMedia M179 card this is normal.");
-@@ -765,6 +813,7 @@
+@@ -771,6 +819,7 @@ static void set_ctrls(int fd, vector<str
for (uint i = 0; i < ext_ctrls.size(); i++)
{
@@ -178,24 +174,23 @@ Index: libs/libmythtv/mpegrecorder.cpp
struct v4l2_ext_controls ctrls;
bzero(&ctrls, sizeof(struct v4l2_ext_controls));
-@@ -774,8 +823,15 @@
+@@ -780,7 +829,14 @@ static void set_ctrls(int fd, vector<str
ctrls.count = 1;
ctrls.controls = &ext_ctrls[i];
- if (ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0)
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(fd, VIDIOC_S_EXT_CTRLS, &ctrls) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
QMutexLocker locker(&control_description_lock);
VERBOSE(VB_IMPORTANT, QString("mpegrecorder.cpp:set_ctrls(): ") +
- QString("Could not set %1 to %2")
-@@ -814,6 +870,30 @@
+@@ -820,6 +876,30 @@ bool MpegRecorder::SetV4L2DeviceOptions(
{
maxbitrate = high_mpeg4peakbitrate;
bitrate = high_mpeg4avgbitrate;
@@ -226,7 +221,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
}
maxbitrate = std::max(maxbitrate, bitrate);
-@@ -837,19 +917,36 @@
+@@ -843,10 +923,19 @@ bool MpegRecorder::SetV4L2DeviceOptions(
int audioinput = audiodevice.toUInt(&ok);
if (ok)
{
@@ -237,35 +232,34 @@ Index: libs/libmythtv/mpegrecorder.cpp
- if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) < 0)
+
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN +
"Unable to get audio input.");
- }
+@@ -854,7 +943,15 @@ bool MpegRecorder::SetV4L2DeviceOptions(
else
{
ain.index = audioinput;
- if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) < 0)
+
+ for (idx = 0; idx < 20; ++idx)
- {
++ {
+ if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) == 0)
+ break;
+ usleep(100 * 1000);
+ }
+
+ if (idx == 20)
-+ {
+ {
VERBOSE(VB_IMPORTANT, LOC_WARN +
"Unable to set audio input.");
- }
-@@ -1036,17 +1133,26 @@
+@@ -1042,17 +1139,26 @@ void MpegRecorder::StartRecording(void)
if (deviceIsMpegFile)
elapsedTimer.start();
else if (_device_read_buffer)
@@ -296,7 +290,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
if (deviceIsMpegFile)
{
-@@ -1090,35 +1196,7 @@
+@@ -1096,35 +1202,7 @@ void MpegRecorder::StartRecording(void)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "Device error detected");
@@ -333,7 +327,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
}
else if (_device_read_buffer->IsEOF())
{
-@@ -1216,6 +1294,8 @@
+@@ -1222,6 +1300,8 @@ void MpegRecorder::StartRecording(void)
}
}
@@ -342,7 +336,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
if (_device_read_buffer)
{
if (_device_read_buffer->IsRunning())
-@@ -1224,6 +1304,7 @@
+@@ -1230,6 +1310,7 @@ void MpegRecorder::StartRecording(void)
delete _device_read_buffer;
_device_read_buffer = NULL;
}
@@ -350,17 +344,12 @@ Index: libs/libmythtv/mpegrecorder.cpp
StopEncoding(readfd);
FinishRecording();
-@@ -1373,52 +1454,95 @@
+@@ -1379,19 +1460,14 @@ bool MpegRecorder::PauseAndWait(int time
if (!paused)
{
+ VERBOSE(VB_RECORD, LOC + "PauseAndWait pause");
+
-+ // Some drivers require streaming to be disabled before
-+ // an input switch and other channel format setting.
-+ if (requires_special_pause)
-+ StopEncoding(readfd);
-+
if (_device_read_buffer)
{
QMutex drb_lock;
@@ -368,20 +357,23 @@ Index: libs/libmythtv/mpegrecorder.cpp
-
_device_read_buffer->SetRequestPause(true);
-
- pauseWait.wait(&drb_lock, timeout);
- }
- else
+- pauseWait.wait(&drb_lock, timeout);
+- }
+- else
- {
- paused = true;
- pauseWait.wakeAll();
-- }
+- pauseWait.wakeAll();
++ _device_read_buffer->WaitForPaused(4000);
+ }
+
+ // Some drivers require streaming to be disabled before
+@@ -1399,32 +1475,76 @@ bool MpegRecorder::PauseAndWait(int time
+ if (requires_special_pause)
+ StopEncoding(readfd);
-- // Some drivers require streaming to be disabled before
-- // an input switch and other channel format setting.
-- if (requires_special_pause)
-- StopEncoding(readfd);
--
+ paused = true;
++ pauseWait.wakeAll();
++
if (tvrec)
tvrec->RecorderPaused();
}
@@ -404,17 +396,10 @@ Index: libs/libmythtv/mpegrecorder.cpp
+ m_h264_parser.Reset();
+ _wait_for_keyframe_option = true;
+ _seen_sps = false;
++ }
- if (_device_read_buffer)
- _device_read_buffer->SetRequestPause(false);
-+ // Sleep any less than 1.5 seconds, and the HD-PVR will
-+ // return the old resolution, when the resolution is changing.
-+ usleep(1500 * 1000);
-+ }
-
-- if (_stream_data)
-- _stream_data->Reset(_stream_data->DesiredProgram());
-- }
+ // Some drivers require streaming to be disabled before
+ // an input switch and other channel format setting.
+ if (requires_special_pause)
@@ -425,7 +410,10 @@ Index: libs/libmythtv/mpegrecorder.cpp
+
+ if (_stream_data)
+ _stream_data->Reset(_stream_data->DesiredProgram());
-+
+
+- if (_stream_data)
+- _stream_data->Reset(_stream_data->DesiredProgram());
+- }
paused = false;
}
+
@@ -467,7 +455,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
bool MpegRecorder::StartEncoding(int fd)
{
QMutexLocker locker(&start_stop_encoding_lock);
-@@ -1427,13 +1551,22 @@
+@@ -1433,13 +1553,22 @@ bool MpegRecorder::StartEncoding(int fd)
memset(&command, 0, sizeof(struct v4l2_encoder_cmd));
command.cmd = V4L2_ENC_CMD_START;
@@ -492,7 +480,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
VERBOSE(VB_RECORD, LOC + "Encoding started");
return true;
}
-@@ -1444,7 +1577,7 @@
+@@ -1450,7 +1579,7 @@ bool MpegRecorder::StartEncoding(int fd)
return false;
}
@@ -501,7 +489,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
}
VERBOSE(VB_IMPORTANT, LOC_ERR + "StartEncoding - giving up" + ENO);
-@@ -1461,9 +1594,8 @@
+@@ -1467,9 +1596,8 @@ bool MpegRecorder::StopEncoding(int fd)
VERBOSE(VB_RECORD, LOC + "StopEncoding");
@@ -512,7 +500,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
if (ioctl(fd, VIDIOC_ENCODER_CMD, &command) == 0)
{
VERBOSE(VB_RECORD, LOC + "Encoding stopped");
-@@ -1476,7 +1608,7 @@
+@@ -1482,7 +1610,7 @@ bool MpegRecorder::StopEncoding(int fd)
return false;
}
@@ -521,7 +509,7 @@ Index: libs/libmythtv/mpegrecorder.cpp
}
VERBOSE(VB_IMPORTANT, LOC_ERR + "StopEncoding - giving up" + ENO);
-@@ -1544,7 +1676,7 @@
+@@ -1550,7 +1678,7 @@ void MpegRecorder::HandleSingleProgramPA
void MpegRecorder::HandleSingleProgramPMT(ProgramMapTable *pmt)
{
if (!pmt)
@@ -530,12 +518,15 @@ Index: libs/libmythtv/mpegrecorder.cpp
return;
}
-@@ -1564,27 +1696,89 @@
+@@ -1570,27 +1698,94 @@ void MpegRecorder::HandleSingleProgramPM
DTVRecorder::BufferedWrite(*(reinterpret_cast<TSPacket*>(&buf[i])));
}
+-void MpegRecorder::HandleResolutionChanges(void)
+bool MpegRecorder::WaitFor_HDPVR(void)
-+{
+ {
+- if (!needs_resolution)
+- return;
+ // After a resolution change, it can take the HD-PVR a few
+ // seconds before it is usable again.
+
@@ -543,6 +534,11 @@ Index: libs/libmythtv/mpegrecorder.cpp
+ // some data.
+ QMutexLocker locker(&start_stop_encoding_lock);
+
++
++ // Sleep any less than 1.5 seconds, and the HD-PVR will
++ // return the old resolution, when the resolution is changing.
++ usleep(1500 * 1000);
+
+ struct v4l2_encoder_cmd command;
+ struct pollfd polls;
+ int idx;
@@ -586,11 +582,8 @@ Index: libs/libmythtv/mpegrecorder.cpp
+ return false;
+}
+
- void MpegRecorder::HandleResolutionChanges(void)
- {
-- if (!needs_resolution)
-- return;
--
++void MpegRecorder::HandleResolutionChanges(void)
++{
VERBOSE(VB_RECORD, LOC + "Checking Resolution");
struct v4l2_format vfmt;
memset(&vfmt, 0, sizeof(vfmt));
@@ -624,35 +617,52 @@ Index: libs/libmythtv/mpegrecorder.cpp
int old_max = maxbitrate, old_avg = bitrate;
if (pix <= 768*568)
-@@ -1609,13 +1803,14 @@
- if (old_max == old_avg)
- {
- VERBOSE(VB_RECORD, LOC +
-- QString("Old bitrate %1 CBR").arg(old_avg));
-+ QString("Old bitrate %1 CBR for %2x%3")
-+ .arg(old_avg).arg(width).arg(height));
- }
- else
- {
- VERBOSE(VB_RECORD, LOC +
-- QString("Old bitrate %1/%2 VBR")
-- .arg(old_avg).arg(old_max));
-+ QString("Old bitrate %1/%2 VBR for %3x%4")
-+ .arg(old_avg).arg(old_max).arg(width).arg(height));
- }
-
- if (maxbitrate == bitrate)
-@@ -1642,12 +1837,6 @@
+@@ -1648,12 +1843,6 @@ void MpegRecorder::HandleResolutionChang
maxbitrate * 1000);
set_ctrls(readfd, ext_ctrls);
-+
- }
--
+- }
+
- // Restart streaming. Shouldn't be needed? seems to be with current driver.
- QMutexLocker locker(&start_stop_encoding_lock);
- StopEncoding(readfd);
- StartEncoding(readfd);
-
- needs_resolution = false;
++ }
}
+Index: libs/libmythtv/mpegrecorder.h
+===================================================================
+--- libs/libmythtv/mpegrecorder.h.orig
++++ libs/libmythtv/mpegrecorder.h
+@@ -80,11 +80,13 @@ class MpegRecorder : public DTVRecorder,
+ uint GetFilteredAudioLayer(void) const;
+ uint GetFilteredAudioBitRate(uint audio_layer) const;
+
++ void RestartEncoding(void);
+ bool StartEncoding(int fd);
+ bool StopEncoding(int fd);
+
+ void ResetForNewFile(void);
+
++ bool WaitFor_HDPVR(void);
+ void HandleResolutionChanges(void);
+
+ inline bool CheckCC(uint pid, uint cc);
+@@ -104,7 +106,6 @@ class MpegRecorder : public DTVRecorder,
+ // State
+ bool recording;
+ bool encoding;
+- bool needs_resolution;
+ mutable QMutex start_stop_encoding_lock;
+ QMutex recording_wait_lock;
+ QWaitCondition recording_wait;
+@@ -113,7 +114,7 @@ class MpegRecorder : public DTVRecorder,
+ bool cleartimeonpause;
+
+ // Encoding info
+- int width, height;
++ uint width, height;
+ int bitrate, maxbitrate, streamtype, aspectratio;
+ int audtype, audsamplerate, audbitratel1, audbitratel2, audbitratel3;
+ int audvolume;
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/myth.sh b/abs/core-testing/mythtv/trunk/mythtv/myth.sh
index fb7122c..fb7122c 100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/myth.sh
+++ b/abs/core-testing/mythtv/trunk/mythtv/myth.sh
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend b/abs/core-testing/mythtv/trunk/mythtv/mythbackend
index f96c6b7..93773a2 100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend
+++ b/abs/core-testing/mythtv/trunk/mythtv/mythbackend
@@ -8,7 +8,7 @@ case "$1" in
start)
stat_busy "Starting MythTV Backend"
[ ! -e /var/run/mysqld.pid ] && echo -n "mysqld not started" && stat_fail && exit
- [ -z "$PID" ] && /usr/local/bin/mythbackend -d -l /var/log/mythbackend.log -v quiet
+ [ -z "$PID" ] && /usr/bin/mythbackend -d -l /var/log/mythbackend.log -v important
if [ $? -gt 0 ]; then
stat_fail
else
@@ -29,6 +29,7 @@ case "$1" in
;;
restart)
$0 stop
+ sleep 1s
$0 start
;;
*)
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend.sh b/abs/core-testing/mythtv/trunk/mythtv/mythbackend.sh
index e7a7b70..e7a7b70 100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/mythbackend.sh
+++ b/abs/core-testing/mythtv/trunk/mythtv/mythbackend.sh
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/mythtv.install b/abs/core-testing/mythtv/trunk/mythtv/mythtv.install
index 513852a..513852a 100755
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/mythtv.install
+++ b/abs/core-testing/mythtv/trunk/mythtv/mythtv.install
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/smolt_jump.patch b/abs/core-testing/mythtv/trunk/mythtv/smolt_jump.patch
index 0fc452a..0fc452a 100644
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/smolt_jump.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/smolt_jump.patch
diff --git a/abs/core-testing/mythtv/trunk/mythtv-svn/svn_main_menu_popup.patch b/abs/core-testing/mythtv/trunk/mythtv/svn_main_menu_popup.patch
index 5556683..5556683 100644
--- a/abs/core-testing/mythtv/trunk/mythtv-svn/svn_main_menu_popup.patch
+++ b/abs/core-testing/mythtv/trunk/mythtv/svn_main_menu_popup.patch
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythvideo/PKGBUILD b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD
index 4087034..4087034 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythvideo/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweather/PKGBUILD b/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD
index 98542b9..98542b9 100644
--- a/abs/core-testing/mythtv/trunk/plugins/mythweather/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/PKGBUILD b/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD
index 52eb059..52eb059 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/PKGBUILD
+++ b/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/dblogininit.inc b/abs/core-testing/mythtv/trunk/mythweb/dblogininit.inc
index c5395c5..c5395c5 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/dblogininit.inc
+++ b/abs/core-testing/mythtv/trunk/mythweb/dblogininit.inc
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/mythweb.install b/abs/core-testing/mythtv/trunk/mythweb/mythweb.install
index 9162d98..9162d98 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/mythweb.install
+++ b/abs/core-testing/mythtv/trunk/mythweb/mythweb.install
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/mythweblighttpd.patch b/abs/core-testing/mythtv/trunk/mythweb/mythweblighttpd.patch
index 6403a88..6403a88 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/mythweblighttpd.patch
+++ b/abs/core-testing/mythtv/trunk/mythweb/mythweblighttpd.patch
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/dblogininit.inc b/abs/core-testing/mythtv/trunk/mythweb/xris/dblogininit.inc
index c5395c5..c5395c5 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/dblogininit.inc
+++ b/abs/core-testing/mythtv/trunk/mythweb/xris/dblogininit.inc
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/lighttpd.conf b/abs/core-testing/mythtv/trunk/mythweb/xris/lighttpd.conf
index ff4e7dd..ff4e7dd 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/lighttpd.conf
+++ b/abs/core-testing/mythtv/trunk/mythweb/xris/lighttpd.conf
diff --git a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/mythweblighttpd.patch b/abs/core-testing/mythtv/trunk/mythweb/xris/mythweblighttpd.patch
index bebc93e..bebc93e 100755
--- a/abs/core-testing/mythtv/trunk/plugins/mythweb/xris/mythweblighttpd.patch
+++ b/abs/core-testing/mythtv/trunk/mythweb/xris/mythweblighttpd.patch