mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Now making sure a spawned timer only fully overlaps the given event
This commit is contained in:
		@@ -3665,6 +3665,8 @@ J
 | 
			
		||||
 event has no short text
 | 
			
		||||
 for reporting a bug in VPS handling when spawning a pattern timer, in case Setup.UseVps
 | 
			
		||||
 is false
 | 
			
		||||
 for reporting an endless spawning of pattern timers in case the spawned timer doesn't
 | 
			
		||||
 use VPS and fully overlaps a second event that is longer than the original one
 | 
			
		||||
 | 
			
		||||
Stefan Verse <Verse@amotronics.de>
 | 
			
		||||
 for fixing an occasional black screen when switching channels
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							@@ -9578,7 +9578,7 @@ Video Disk Recorder Revision History
 | 
			
		||||
  given (reported by Manuel Reimer).
 | 
			
		||||
- Fixed handling $(PKG_CONFIG) in newplugin (thanks to Winfried K<>hler).
 | 
			
		||||
 | 
			
		||||
2021-01-18:
 | 
			
		||||
2021-01-19:
 | 
			
		||||
 | 
			
		||||
- Fixed strreplace() to handle NULL strings (reported by J<>rgen Schneider).
 | 
			
		||||
- Somewhere down the road the 'x' bit of Doxyfile.filter got lost, so the
 | 
			
		||||
@@ -9601,3 +9601,5 @@ Video Disk Recorder Revision History
 | 
			
		||||
  (thanks to Peter Bieringer).
 | 
			
		||||
- Fixed setting the 'title' of a recording's info to the recording's name if there
 | 
			
		||||
  is no info file (the change in version 1.7.28 broke the fallback to the old 'summary.vdr').
 | 
			
		||||
- Now making sure a spawned timer only fully overlaps the given event (reported by
 | 
			
		||||
  J<>rgen Schneider).
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								timers.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								timers.c
									
									
									
									
									
								
							@@ -4,7 +4,7 @@
 | 
			
		||||
 * See the main source file 'vdr.c' for copyright information and
 | 
			
		||||
 * how to reach the author.
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: timers.c 5.4 2021/01/15 13:52:40 kls Exp $
 | 
			
		||||
 * $Id: timers.c 5.5 2021/01/19 13:21:51 kls Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "timers.h"
 | 
			
		||||
@@ -191,8 +191,18 @@ cTimer::cTimer(const cEvent *Event, const char *FileName, const cTimer *PatternT
 | 
			
		||||
  time_t tstart = (flags & tfVps) ? Event->Vps() : Event->StartTime();
 | 
			
		||||
  time_t tstop = tstart + Event->Duration();
 | 
			
		||||
  if (!(HasFlags(tfVps))) {
 | 
			
		||||
     tstop  += Setup.MarginStop * 60;
 | 
			
		||||
     tstart -= Setup.MarginStart * 60;
 | 
			
		||||
     int MarginStart = Setup.MarginStart * 60;
 | 
			
		||||
     int MarginStop  = Setup.MarginStop * 60;
 | 
			
		||||
     if (PatternTimer) {
 | 
			
		||||
        // To make sure a spawned timer gets assigned to the correct event, we must
 | 
			
		||||
        // make sure that this is the only event that overlaps 100%:
 | 
			
		||||
        if (const cEvent *e = dynamic_cast<const cEvent *>(Event->Prev()))
 | 
			
		||||
           MarginStart = max(0, min(MarginStart, e->Duration() - 60));
 | 
			
		||||
        if (const cEvent *e = dynamic_cast<const cEvent *>(Event->Next()))
 | 
			
		||||
           MarginStop = max(0, min(MarginStop, e->Duration() - 60));
 | 
			
		||||
        }
 | 
			
		||||
     tstart -= MarginStart;
 | 
			
		||||
     tstop  += MarginStop;
 | 
			
		||||
     }
 | 
			
		||||
  struct tm tm_r;
 | 
			
		||||
  struct tm *time = localtime_r(&tstart, &tm_r);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user