r4766 - in /vdr/vdr-plugin-live/trunk/debian: changelog patches/00list patches/01_tnt-1.6.0.dpatch patches/91_timer-delete-fix.dpatch

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Thu Jun 21 21:31:19 UTC 2007


Author: tiber-guest
Date: Thu Jun 21 21:31:19 2007
New Revision: 4766

URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/?sc=1&rev=4766
Log:
* Added patch for new version of libtntnet-dev in Sid
* Added 91_timer-delete-fix.dpatch

Added:
    vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch   (with props)
    vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch   (with props)
Modified:
    vdr/vdr-plugin-live/trunk/debian/changelog
    vdr/vdr-plugin-live/trunk/debian/patches/00list

Modified: vdr/vdr-plugin-live/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-live/trunk/debian/changelog?rev=4766&op=diff
==============================================================================
--- vdr/vdr-plugin-live/trunk/debian/changelog (original)
+++ vdr/vdr-plugin-live/trunk/debian/changelog Thu Jun 21 21:31:19 2007
@@ -1,3 +1,10 @@
+vdr-plugin-live (0.1.0-2) unstable; urgency=low
+
+  * Added patch for new version of libtntnet-dev in Sid
+  * Added 91_timer-delete-fix.dpatch
+
+ -- Tobias Grimm <tg at e-tobi.net>  Thu, 21 Jun 2007 23:31:10 +0200
+
 vdr-plugin-live (0.1.0-1) unstable; urgency=low
 
   * Initial release (Closes: #426762)

Modified: vdr/vdr-plugin-live/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-live/trunk/debian/patches/00list?rev=4766&op=diff
==============================================================================
--- vdr/vdr-plugin-live/trunk/debian/patches/00list (original)
+++ vdr/vdr-plugin-live/trunk/debian/patches/00list Thu Jun 21 21:31:19 2007
@@ -1,1 +1,3 @@
+01_tnt-1.6.0
 90_clean
+91_timer-delete-fix

Added: vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch?rev=4766&op=file
==============================================================================
--- vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch (added)
+++ vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch Thu Jun 21 21:31:19 2007
@@ -1,0 +1,29 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_tnt-1.2.6.dpatch by Tobias Grimm <tg at e-tobi.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Makes vdr-plugin-live compile with libtntnet 1.6.0 and 1.5.3
+
+ at DPATCH@
+diff -urNad vdr-plugin-live-0.1.0~/httpd/worker.cpp vdr-plugin-live-0.1.0/httpd/worker.cpp
+--- vdr-plugin-live-0.1.0~/httpd/worker.cpp	2007-01-02 20:18:27.000000000 +0100
++++ vdr-plugin-live-0.1.0/httpd/worker.cpp	2007-06-21 23:18:04.000000000 +0200
+@@ -25,6 +25,7 @@
+ #include <tnt/httperror.h>
+ #include <tnt/http.h>
+ #include <tnt/poller.h>
++#include <tnt/mimedb.h>
+ #include <cxxtools/log.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+@@ -77,7 +78,10 @@
+   {
+     cxxtools::MutexLock lock(mutex);
+     workers.erase(this);
++// Very ugly hack to check if we are using the new version of libtntnet in Sid, that does not have the cleanup function
++#ifdef TNT_MIME_H
+     comploader.cleanup();
++#endif
+ 
+     log_debug("delete worker " << threadId << " - " << workers.size() << " threads left - " << application.getQueue().getWaitThreadCount() << " waiting threads");
+   }

Propchange: vdr/vdr-plugin-live/trunk/debian/patches/01_tnt-1.6.0.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Added: vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch
URL: http://svn.debian.org/wsvn/pkg-vdr-dvb/vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch?rev=4766&op=file
==============================================================================
--- vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch (added)
+++ vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch Thu Jun 21 21:31:19 2007
@@ -1,0 +1,167 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 91_timer-delete-fix.dpath.dpatch by Tobias Grimm <tg at e-tobi.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fixes crashes when deleting timers (taken from upstream SVN)
+
+ at DPATCH@
+diff -urNad vdr-plugin-live-0.1.0~/timers.cpp vdr-plugin-live-0.1.0/timers.cpp
+--- vdr-plugin-live-0.1.0~/timers.cpp	2007-05-03 20:17:16.000000000 +0200
++++ vdr-plugin-live-0.1.0/timers.cpp	2007-06-21 23:24:12.000000000 +0200
+@@ -15,6 +15,9 @@
+ using namespace std;
+ using namespace vdrlive;
+ 
++static char const* const TIMER_DELETE = "DELETE";
++static char const* const TIMER_TOGGLE = "TOGGLE";
++
+ SortedTimers::SortedTimers():
+ 		m_state( 0 )
+ {
+@@ -79,6 +82,8 @@
+ void TimerManager::UpdateTimer( cTimer* timer, int flags, tChannelID& channel, string const& weekdays, string const& day,
+ 								int start, int stop, int priority, int lifetime, string const& title, string const& aux )
+ {
++	cMutexLock lock( this );
++
+ 	ostringstream builder;
+ 	builder << flags << ":" << channel << ":" << ( weekdays != "-------" ? weekdays : "" )
+ 			<< ( weekdays == "-------" || day.empty() ? "" : "@" ) << day << ":" << start << ":" << stop << ":"
+@@ -98,22 +103,33 @@
+ 		throw HtmlError( error );
+ }
+ 
+-void TimerManager::DelTimer( cTimer* timer)
++void TimerManager::DelTimer( cTimer* timer )
+ {
+-	cTimer* delTimer = Timers.GetTimer(timer);
+-	Timers.Del(delTimer, true);
+-	Timers.SetModified();
+-	m_timers.ReloadTimers(false);
++	cMutexLock lock( this );
++
++	TimerPair timerData( timer, TIMER_DELETE );
++
++	m_updateTimers.push_back( timerData );
++	m_updateWait.Wait( *this );
++
++	string error = GetError( timerData );
++	if ( !error.empty() )
++		throw HtmlError( error );
+ }
+ 
+ void TimerManager::ToggleTimerActive( cTimer* timer)
+ {
+-	cTimer* toggleTimer = Timers.GetTimer(timer);
+-	toggleTimer->OnOff();
+-	Timers.SetModified();
+-	m_timers.ReloadTimers(false);
+-}
++	cMutexLock lock( this );
+ 
++	TimerPair timerData( timer, TIMER_TOGGLE );
++
++	m_updateTimers.push_back( timerData );
++	m_updateWait.Wait( *this );
++
++	string error = GetError( timerData );
++	if ( !error.empty() )
++		throw HtmlError( error );
++}
+ 
+ void TimerManager::DoPendingWork()
+ {
+@@ -123,10 +139,10 @@
+ 	cMutexLock lock( this );
+ 	if ( m_updateTimers.size() > 0 ) {
+ 		DoUpdateTimers();
+-		dsyslog("SV: signalling waiters");
+-		m_updateWait.Broadcast();
+ 	}
+ 	DoReloadTimers();
++	dsyslog("SV: signalling waiters");
++	m_updateWait.Broadcast();
+ }
+ 
+ void TimerManager::DoUpdateTimers()
+@@ -135,8 +151,10 @@
+ 	for ( TimerList::iterator timer = m_updateTimers.begin(); timer != m_updateTimers.end(); ++timer ) {
+ 		if ( timer->first == 0 ) // new timer
+ 			DoInsertTimer( *timer );
+-		else if ( timer->second == "" ) // delete timer
+-			; // XXX
++		else if ( timer->second == TIMER_DELETE ) // delete timer
++			DoDeleteTimer( *timer );
++		else if ( timer->second == TIMER_TOGGLE ) // toggle timer
++			DoToggleTimer( *timer );
+ 		else // update timer
+ 			DoUpdateTimer( *timer );
+ 	}
+@@ -187,6 +205,47 @@
+ 	isyslog("live timer %s modified (%s)", *oldTimer->ToDescr(), oldTimer->HasFlags(tfActive) ? "active" : "inactive");
+ }
+ 
++void TimerManager::DoDeleteTimer( TimerPair& timerData )
++{
++	if ( Timers.BeingEdited() ) {
++		StoreError( timerData, tr("Timers are being edited - try again later") );
++		return;
++	}
++
++	cTimer* oldTimer = Timers.GetTimer( timerData.first );
++	if ( oldTimer == 0 ) {
++		StoreError( timerData, tr("Timer not defined") );
++		return;
++	}
++
++	cTimer copy = *oldTimer;
++	if ( oldTimer->Recording() ) {
++		oldTimer->Skip();
++		cRecordControls::Process( time( 0 ) );
++	}
++	Timers.Del( oldTimer );
++	Timers.SetModified();
++	isyslog("live timer %s deleted", *copy.ToDescr());
++}
++
++void TimerManager::DoToggleTimer( TimerPair& timerData )
++{
++	if ( Timers.BeingEdited() ) {
++		StoreError( timerData, tr("Timers are being edited - try again later") );
++		return;
++	}
++
++	cTimer* toggleTimer = Timers.GetTimer( timerData.first );
++	if ( toggleTimer == 0 ) {
++		StoreError( timerData, tr("Timer not defined") );
++		return;
++	}
++
++	toggleTimer->OnOff();
++	Timers.SetModified();
++	isyslog("live timer %s toggled %s", *toggleTimer->ToDescr(), toggleTimer->HasFlags(tfActive) ? "on" : "off");
++}
++
+ void TimerManager::StoreError( TimerPair const& timerData, std::string const& error )
+ {
+ 	m_failedUpdates.push_back( ErrorPair( timerData, error ) );
+diff -urNad vdr-plugin-live-0.1.0~/timers.h vdr-plugin-live-0.1.0/timers.h
+--- vdr-plugin-live-0.1.0~/timers.h	2007-05-03 20:17:16.000000000 +0200
++++ vdr-plugin-live-0.1.0/timers.h	2007-06-21 23:24:12.000000000 +0200
+@@ -4,6 +4,7 @@
+ #include <list>
+ #include <string>
+ #include <vdr/channels.h>
++#include <vdr/menu.h>
+ #include <vdr/timers.h>
+ #include <vdr/thread.h>
+ #include "live.h"
+@@ -63,6 +64,8 @@
+ 	void DoUpdateTimers();
+ 	void DoInsertTimer( TimerPair& timerData );
+ 	void DoUpdateTimer( TimerPair& timerData );
++	void DoDeleteTimer( TimerPair& timerData );
++	void DoToggleTimer( TimerPair& timerData );
+ 
+ 	void StoreError( TimerPair const& timerData, std::string const& error );
+ 	std::string GetError( TimerPair const& timerData );

Propchange: vdr/vdr-plugin-live/trunk/debian/patches/91_timer-delete-fix.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the pkg-vdr-dvb-changes mailing list