mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-11-01 04:53:04 +08:00 
			
		
		
		
	examples/demuxing_decoding: return error when no codec found
The open_codec_context function, when it fails to find a codec, now return AVERROR(EINVAL) to signal an error. Before it would return the stream index, which was always >= 0, and continue as if a codec was found. This change make it fail faster, instead of repeated failed tries to decode frames with no codec. Signed-off-by: Even Wiik Thomassen <e.thomassen@sportradar.com> Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
This commit is contained in:
		 Even Wiik Thomassen
					Even Wiik Thomassen
				
			
				
					committed by
					
						 Stefano Sabatini
						Stefano Sabatini
					
				
			
			
				
	
			
			
			 Stefano Sabatini
						Stefano Sabatini
					
				
			
						parent
						
							65a3429e7a
						
					
				
				
					commit
					43f116d162
				
			| @@ -159,7 +159,7 @@ static int open_codec_context(int *stream_idx, | |||||||
|         if (!dec) { |         if (!dec) { | ||||||
|             fprintf(stderr, "Failed to find %s codec\n", |             fprintf(stderr, "Failed to find %s codec\n", | ||||||
|                     av_get_media_type_string(type)); |                     av_get_media_type_string(type)); | ||||||
|             return ret; |             return AVERROR(EINVAL); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         /* Init the decoders, with or without reference counting */ |         /* Init the decoders, with or without reference counting */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user