You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavd: fix iterating of input and output devices
In the previous implementation the first input or output device was skipped when device_next was called with prev = NULL Signed-off-by: Felix Matouschek <felix@matouschek.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
		
				
					committed by
					
						 Timo Rothenpieler
						Timo Rothenpieler
					
				
			
			
				
	
			
			
			
						parent
						
							3e7fa34d3b
						
					
				
				
					commit
					ce1d77a5e7
				
			| @@ -126,16 +126,13 @@ static void *device_next(void *prev, int output, | ||||
|  | ||||
|     ff_thread_once(&av_device_next_init, av_device_init_next); | ||||
|  | ||||
|     if (!prev && !(prev = (output ? (void*)outdev_list[0] : (void*)indev_list[0]))) | ||||
|         return NULL; | ||||
|  | ||||
|     do { | ||||
|         if (output) { | ||||
|             if (!(prev = ((AVOutputFormat *)prev)->next)) | ||||
|             if (!(prev = prev ? ((AVOutputFormat *)prev)->next : (void*)outdev_list[0])) | ||||
|                 break; | ||||
|             pc = ((AVOutputFormat *)prev)->priv_class; | ||||
|         } else { | ||||
|             if (!(prev = ((AVInputFormat *)prev)->next)) | ||||
|             if (!(prev = prev ? ((AVInputFormat *)prev)->next : (void*)indev_list[0])) | ||||
|                 break; | ||||
|             pc = ((AVInputFormat *)prev)->priv_class; | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user