mirror of
				https://github.com/rofafor/vdr-plugin-satip.git
				synced 2023-10-10 11:37:42 +00:00 
			
		
		
		
	Check source validity also in server assign (Thanks to Patrick Boettcher).
This commit is contained in:
		
							
								
								
									
										28
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								server.c
									
									
									
									
									
								
							| @@ -204,9 +204,23 @@ int cSatipServer::Compare(const cListObject &listObjectP) const | |||||||
|   return result; |   return result; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | bool cSatipServer::IsValidSource(int sourceP) | ||||||
|  | { | ||||||
|  |   if (sourceFiltersM[0]) { | ||||||
|  |      for (unsigned int i = 0; i < ELEMENTS(sourceFiltersM); ++i) { | ||||||
|  |          if (sourceP == sourceFiltersM[i]) { | ||||||
|  |             return true; | ||||||
|  |             } | ||||||
|  |          } | ||||||
|  |      return false; | ||||||
|  |      } | ||||||
|  |   return true; | ||||||
|  | } | ||||||
|  |  | ||||||
| bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP) | bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transponderP) | ||||||
| { | { | ||||||
|   bool result = false; |   bool result = false; | ||||||
|  |   if (IsValidSource(sourceP)) { | ||||||
|      if (cSource::IsType(sourceP, 'S')) |      if (cSource::IsType(sourceP, 'S')) | ||||||
|         result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP); |         result = frontendsM[eSatipFrontendDVBS2].Assign(deviceIdP, transponderP); | ||||||
|      else if (cSource::IsType(sourceP, 'T')) { |      else if (cSource::IsType(sourceP, 'T')) { | ||||||
| @@ -221,22 +235,10 @@ bool cSatipServer::Assign(int deviceIdP, int sourceP, int systemP, int transpond | |||||||
|         else |         else | ||||||
|            result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP); |            result = frontendsM[eSatipFrontendDVBC].Assign(deviceIdP, transponderP) || frontendsM[eSatipFrontendDVBC2].Assign(deviceIdP, transponderP); | ||||||
|         } |         } | ||||||
|  |      } | ||||||
|   return result; |   return result; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cSatipServer::IsValidSource(int sourceP) |  | ||||||
| { |  | ||||||
|   if (sourceFiltersM[0]) { |  | ||||||
|      for (unsigned int i = 0; i < ELEMENTS(sourceFiltersM); ++i) { |  | ||||||
|          if (sourceP == sourceFiltersM[i]) { |  | ||||||
|             return true; |  | ||||||
|             } |  | ||||||
|          } |  | ||||||
|      return false; |  | ||||||
|      } |  | ||||||
|   return true; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| bool cSatipServer::Matches(int sourceP) | bool cSatipServer::Matches(int sourceP) | ||||||
| { | { | ||||||
|   if (IsValidSource(sourceP)) { |   if (IsValidSource(sourceP)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user