mirror of
				https://github.com/rofafor/vdr-plugin-iptv.git
				synced 2023-10-10 11:37:03 +00:00 
			
		
		
		
	Prevent busylooping in GetTSPacket() and modified RTP to accect any TS stream.
This commit is contained in:
		
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -15,3 +15,5 @@ VDR Plugin 'iptv' Revision History | ||||
| 2007-xx-xx: Version 0.0.3 | ||||
|  | ||||
| - Fixed shutdown crash. | ||||
| - Added some minor tweaks. | ||||
| - RTP payload now restricted to TS only. | ||||
|   | ||||
							
								
								
									
										6
									
								
								device.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								device.c
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: device.c,v 1.74 2007/10/22 19:32:19 ajhseppa Exp $ | ||||
|  * $Id: device.c,v 1.75 2007/10/26 22:07:10 rahrenbe Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "config.h" | ||||
| @@ -384,7 +384,11 @@ bool cIptvDevice::GetTSPacket(uchar *&Data) | ||||
|             } | ||||
|         return true; | ||||
|         } | ||||
|      else | ||||
|         cCondWait::SleepMs(100); // to reduce cpu load | ||||
|      } | ||||
|   else | ||||
|      cCondWait::SleepMs(100); // and avoid busy loop | ||||
|   Data = NULL; | ||||
|   return true; | ||||
| } | ||||
|   | ||||
							
								
								
									
										11
									
								
								socket.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								socket.c
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | ||||
|  * | ||||
|  * See the README file for copyright information and how to reach the author. | ||||
|  * | ||||
|  * $Id: socket.c,v 1.5 2007/10/21 19:46:03 rahrenbe Exp $ | ||||
|  * $Id: socket.c,v 1.6 2007/10/26 22:07:10 rahrenbe Exp $ | ||||
|  */ | ||||
|  | ||||
| #include <sys/types.h> | ||||
| @@ -142,8 +142,8 @@ int cIptvUdpSocket::Read(unsigned char* *BufferAddr) | ||||
|         unsigned int x = (readBuffer[0] >> 4) & 0x01; | ||||
|         // cscr count | ||||
|         unsigned int cc = readBuffer[0] & 0x0F; | ||||
|         // payload type | ||||
|         unsigned int pt = readBuffer[1] & 0x7F; | ||||
|         // payload type: MPEG2 TS = 33 | ||||
|         //unsigned int pt = readBuffer[1] & 0x7F; | ||||
|         // header lenght | ||||
|         unsigned int headerlen = (3 + cc) * sizeof(uint32_t); | ||||
|         // check if extension | ||||
| @@ -153,9 +153,8 @@ int cIptvUdpSocket::Read(unsigned char* *BufferAddr) | ||||
|            // update header length | ||||
|            headerlen += (ehl + 1) * sizeof(uint32_t); | ||||
|            } | ||||
|         // Check that rtp is version 2, payload type is MPEG2 TS | ||||
|         // and payload contains multiple of TS packet data | ||||
|         if ((v == 2) && (pt == 33) && (((len - headerlen) % TS_SIZE) == 0)) { | ||||
|         // Check that rtp is version 2 and payload contains multiple of TS packet data | ||||
|         if ((v == 2) && (((len - headerlen) % TS_SIZE) == 0) && (readBuffer[headerlen] == 0x47)) { | ||||
|            // Set argument point to payload in read buffer | ||||
|            *BufferAddr = &readBuffer[headerlen]; | ||||
|            return (len - headerlen); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user