Simplify extract_inout() as suggested by Michael
Commited in SoC by Vitor Sessak on 2008-04-23 18:01:31 Originally committed as revision 13324 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									c9987633b1
								
							
						
					
					
						commit
						fec2e51385
					
				| @ -179,26 +179,15 @@ static void free_inout(AVFilterInOut *head) | |||||||
| static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links) | static AVFilterInOut *extract_inout(const char *label, AVFilterInOut **links) | ||||||
| { | { | ||||||
|     AVFilterInOut *ret; |     AVFilterInOut *ret; | ||||||
|     AVFilterInOut *p; |  | ||||||
| 
 | 
 | ||||||
|     if(!links || !*links) |  | ||||||
|         return NULL; |  | ||||||
| 
 | 
 | ||||||
|     if(!strcmp((*links)->name, label)) { |     while(*links && strcmp((*links)->name, label)) | ||||||
|         ret = *links; |         links= &((*links)->next); | ||||||
|         *links = (*links)->next; |  | ||||||
|         return ret; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /* First check if the label is not in the openLinks list */ |     ret= *links; | ||||||
|     for(p = *links; p->next && strcmp(p->next->name, label); p = p->next); |  | ||||||
| 
 | 
 | ||||||
|     if(!p->next) |     if(ret) | ||||||
|         return NULL; |         *links= ret->next; | ||||||
| 
 |  | ||||||
|     ret = p->next; |  | ||||||
| 
 |  | ||||||
|     p->next = p->next->next; |  | ||||||
| 
 | 
 | ||||||
|     return ret; |     return ret; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user