FLV Socket lezer fix
This commit is contained in:
		
							parent
							
								
									981304acaf
								
							
						
					
					
						commit
						206eb006a9
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -2,17 +2,21 @@ SWBaseSocket::SWBaseError SWBerr; | |||
| char * FLVbuffer; | ||||
| int FLV_len; | ||||
| int FLVbs = 0; | ||||
| bool HeaderDone = false; | ||||
| static char FLVheader[13]; | ||||
| 
 | ||||
| void FLV_Readheader(SWUnixSocket & ss){ | ||||
|   static char header[13]; | ||||
|   while (ss.frecv(header, 13, &SWBerr) != 13){ | ||||
|     //wait
 | ||||
|   } | ||||
| }//FLV_Readheader
 | ||||
| 
 | ||||
| void FLV_Dump(){FLV_len = 0;} | ||||
| 
 | ||||
| bool FLV_GetPacket(SWUnixSocket & ss){ | ||||
|   if (!HeaderDone){ | ||||
|     if (ss.frecv(FLVheader, 13, &SWBerr) == 13){HeaderDone = true;} | ||||
|     return false; | ||||
|   } | ||||
| 
 | ||||
|    | ||||
|   if (FLVbs < 15){FLVbuffer = (char*)realloc(FLVbuffer, 15); FLVbs = 15;} | ||||
|   //if received a whole header, receive a whole packet
 | ||||
|   //if not, retry header next pass
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma