mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	After a CLRE command, no further EPG processing is now done for 10 seconds
This commit is contained in:
		| @@ -602,6 +602,7 @@ Helmut Auer <vdr@helmutauer.de> | |||||||
|  for making the SVDRP command PUTE support reading the EPG data from a given file |  for making the SVDRP command PUTE support reading the EPG data from a given file | ||||||
|  for a patch that was used to implement the command line options --edit and |  for a patch that was used to implement the command line options --edit and | ||||||
|  --genindex |  --genindex | ||||||
|  |  for suggesting to disable EPG processing for a while after a CLRE command | ||||||
|  |  | ||||||
| Jeremy Hall <jhall@UU.NET> | Jeremy Hall <jhall@UU.NET> | ||||||
|  for fixing an incomplete initialization of the filter parameters in eit.c |  for fixing an incomplete initialization of the filter parameters in eit.c | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -6267,3 +6267,6 @@ Video Disk Recorder Revision History | |||||||
|   IMPORTANT NOTE: if VDR doesn't display a parental rating, this does not |   IMPORTANT NOTE: if VDR doesn't display a parental rating, this does not | ||||||
|   necessarily mean that the given programme is suitable for all audiences! |   necessarily mean that the given programme is suitable for all audiences! | ||||||
| - Rearranged cEvent members to minimize memory waste. | - Rearranged cEvent members to minimize memory waste. | ||||||
|  | - After a CLRE command, no further EPG processing is now done for 10 seconds, | ||||||
|  |   so that data sent with subsequent PUTE commands doesn't interfere with data | ||||||
|  |   from the broadcasters (suggested by Helmut Auer). | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								eit.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								eit.c
									
									
									
									
									
								
							| @@ -8,7 +8,7 @@ | |||||||
|  * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. |  * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. | ||||||
|  * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. |  * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. | ||||||
|  * |  * | ||||||
|  * $Id: eit.c 2.9 2010/01/03 13:39:48 kls Exp $ |  * $Id: eit.c 2.10 2010/01/03 15:35:21 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "eit.h" | #include "eit.h" | ||||||
| @@ -351,6 +351,8 @@ cTDT::cTDT(const u_char *Data) | |||||||
|  |  | ||||||
| // --- cEitFilter ------------------------------------------------------------ | // --- cEitFilter ------------------------------------------------------------ | ||||||
|  |  | ||||||
|  | time_t cEitFilter::disableUntil = 0; | ||||||
|  |  | ||||||
| cEitFilter::cEitFilter(void) | cEitFilter::cEitFilter(void) | ||||||
| { | { | ||||||
|   Set(0x12, 0x40, 0xC0);  // event info now&next actual/other TS (0x4E/0x4F), future actual/other TS (0x5X/0x6X) |   Set(0x12, 0x40, 0xC0);  // event info now&next actual/other TS (0x4E/0x4F), future actual/other TS (0x5X/0x6X) | ||||||
| @@ -358,8 +360,19 @@ cEitFilter::cEitFilter(void) | |||||||
|      Set(0x14, 0x70);     // TDT |      Set(0x14, 0x70);     // TDT | ||||||
| } | } | ||||||
|  |  | ||||||
|  | void cEitFilter::SetDisableUntil(time_t Time) | ||||||
|  | { | ||||||
|  |   disableUntil = Time; | ||||||
|  | } | ||||||
|  |  | ||||||
| void cEitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length) | void cEitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length) | ||||||
| { | { | ||||||
|  |   if (disableUntil) { | ||||||
|  |      if (time(NULL) > disableUntil) | ||||||
|  |         disableUntil = 0; | ||||||
|  |      else | ||||||
|  |         return; | ||||||
|  |      } | ||||||
|   switch (Pid) { |   switch (Pid) { | ||||||
|     case 0x12: { |     case 0x12: { | ||||||
|          if (Tid >= 0x4E && Tid <= 0x6F) { |          if (Tid >= 0x4E && Tid <= 0x6F) { | ||||||
|   | |||||||
							
								
								
									
										5
									
								
								eit.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								eit.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * how to reach the author. | ||||||
|  * |  * | ||||||
|  * $Id: eit.h 1.30 2003/12/21 14:51:50 kls Exp $ |  * $Id: eit.h 2.1 2010/01/03 15:28:34 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifndef __EIT_H | #ifndef __EIT_H | ||||||
| @@ -13,10 +13,13 @@ | |||||||
| #include "filter.h" | #include "filter.h" | ||||||
|  |  | ||||||
| class cEitFilter : public cFilter { | class cEitFilter : public cFilter { | ||||||
|  | private: | ||||||
|  |   static time_t disableUntil; | ||||||
| protected: | protected: | ||||||
|   virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length); |   virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length); | ||||||
| public: | public: | ||||||
|   cEitFilter(void); |   cEitFilter(void); | ||||||
|  |   static void SetDisableUntil(time_t Time); | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
| #endif //__EIT_H | #endif //__EIT_H | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								svdrp.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								svdrp.c
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ | |||||||
|  * and interact with the Video Disk Recorder - or write a full featured |  * and interact with the Video Disk Recorder - or write a full featured | ||||||
|  * graphical interface that sits on top of an SVDRP connection. |  * graphical interface that sits on top of an SVDRP connection. | ||||||
|  * |  * | ||||||
|  * $Id: svdrp.c 2.6 2009/10/18 14:08:58 kls Exp $ |  * $Id: svdrp.c 2.7 2010/01/03 15:41:26 kls Exp $ | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "svdrp.h" | #include "svdrp.h" | ||||||
| @@ -179,6 +179,8 @@ bool cPUTEhandler::Process(const char *s) | |||||||
| // --- cSVDRP ---------------------------------------------------------------- | // --- cSVDRP ---------------------------------------------------------------- | ||||||
|  |  | ||||||
| #define MAXHELPTOPIC 10 | #define MAXHELPTOPIC 10 | ||||||
|  | #define EITDISABLETIME 10 // seconds until EIT processing is enabled again after a CLRE command | ||||||
|  |                           // adjust the help for CLRE accordingly if changing this! | ||||||
|  |  | ||||||
| const char *HelpPages[] = { | const char *HelpPages[] = { | ||||||
|   "CHAN [ + | - | <number> | <name> | <id> ]\n" |   "CHAN [ + | - | <number> | <name> | <id> ]\n" | ||||||
| @@ -187,7 +189,10 @@ const char *HelpPages[] = { | |||||||
|   "    it returns the current channel number and name.", |   "    it returns the current channel number and name.", | ||||||
|   "CLRE [ <number> | <name> | <id> ]\n" |   "CLRE [ <number> | <name> | <id> ]\n" | ||||||
|   "    Clear the EPG list of the given channel number, name or id.\n" |   "    Clear the EPG list of the given channel number, name or id.\n" | ||||||
|   "    Without option it clears the entire EPG list.", |   "    Without option it clears the entire EPG list.\n" | ||||||
|  |   "    After a CLRE command, no further EPG processing is done for 10\n" | ||||||
|  |   "    seconds, so that data sent with subsequent PUTE commands doesn't\n" | ||||||
|  |   "    interfere with data from the broadcasters.", | ||||||
|   "DELC <number>\n" |   "DELC <number>\n" | ||||||
|   "    Delete channel.", |   "    Delete channel.", | ||||||
|   "DELR <number>\n" |   "DELR <number>\n" | ||||||
| @@ -574,6 +579,7 @@ void cSVDRP::CmdCLRE(const char *Option) | |||||||
|                } |                } | ||||||
|            if (Schedule) { |            if (Schedule) { | ||||||
|               Schedule->Cleanup(INT_MAX); |               Schedule->Cleanup(INT_MAX); | ||||||
|  |               cEitFilter::SetDisableUntil(time(NULL) + EITDISABLETIME); | ||||||
|               Reply(250, "EPG data of channel \"%s\" cleared", Option); |               Reply(250, "EPG data of channel \"%s\" cleared", Option); | ||||||
|               } |               } | ||||||
|            else { |            else { | ||||||
| @@ -589,6 +595,7 @@ void cSVDRP::CmdCLRE(const char *Option) | |||||||
|      } |      } | ||||||
|   else { |   else { | ||||||
|      cSchedules::ClearAll(); |      cSchedules::ClearAll(); | ||||||
|  |      cEitFilter::SetDisableUntil(time(NULL) + EITDISABLETIME); | ||||||
|      Reply(250, "EPG data cleared"); |      Reply(250, "EPG data cleared"); | ||||||
|      } |      } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user