mirror of
				https://github.com/owntone/owntone-server.git
				synced 2025-10-30 00:05:05 -04:00 
			
		
		
		
	[configure] Add option to use old ffmpeg API (issue #502)
Seems ffmpeg 3.4 has a bug in the new API that causes a crash when avcodec_send_frame() is called. The bug is fixed in 3.4.2. The new option --disable-modern-av-api allows for building with the old API, i.e. no avcodec_send_frame(), even if ffmpeg support is detected at configure time. The option may also become useful for easier testing of legacy mode.
This commit is contained in:
		
							parent
							
								
									d5ec17ffe0
								
							
						
					
					
						commit
						5e13bac867
					
				
							
								
								
									
										56
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										56
									
								
								configure.ac
									
									
									
									
									
								
							| @ -229,35 +229,37 @@ FORK_MODULES_CHECK([FORKED], [LIBAV], | ||||
| 		[libavutil/avutil.h]) | ||||
| 	 FORK_CHECK_DECLS([avformat_network_init], | ||||
| 		[libavformat/avformat.h]) | ||||
| 	 dnl Check if we have modern or legacy AV apis | ||||
| 	 dnl Check if we have modern or legacy AV api | ||||
| 	 FORK_CHECK_DECLS([avcodec_send_packet, avcodec_parameters_from_context], | ||||
| 	 	[libavcodec/avcodec.h], | ||||
| 		[[modern_av_apis=yes]], | ||||
| 		[[modern_av_apis=no] | ||||
| 		 FORK_CHECK_DECLS([av_buffersrc_add_frame_flags], | ||||
| 			[libavfilter/buffersrc.h]) | ||||
| 		 FORK_CHECK_DECLS([av_buffersink_get_frame], | ||||
| 			[libavfilter/buffersink.h]) | ||||
| 		 FORK_CHECK_DECLS([avfilter_graph_parse_ptr], | ||||
| 			[libavfilter/avfilter.h]) | ||||
| 		 FORK_CHECK_DECLS([av_packet_unref], | ||||
| 			[libavcodec/avcodec.h]) | ||||
| 		 FORK_CHECK_DECLS([av_packet_rescale_ts], | ||||
| 			[libavcodec/avcodec.h]) | ||||
| 		 FORK_CHECK_DECLS([avformat_alloc_output_context2], | ||||
| 			[libavformat/avformat.h]) | ||||
| 		 FORK_CHECK_DECLS([av_frame_alloc], | ||||
| 			[libavutil/frame.h]) | ||||
| 		 FORK_CHECK_DECLS([av_frame_get_best_effort_timestamp], | ||||
| 			[libavutil/frame.h]) | ||||
| 		 FORK_CHECK_DECLS([av_image_fill_arrays], | ||||
| 			[libavutil/imgutils.h]) | ||||
| 		 FORK_CHECK_DECLS([av_image_get_buffer_size], | ||||
| 			[libavutil/imgutils.h]) | ||||
| 		 AC_CHECK_HEADERS([libavutil/channel_layout.h libavutil/mathematics.h]) | ||||
| 		]) | ||||
| 		[libavcodec/avcodec.h],	[[libav_modern_api=yes]], [[libav_modern_api=no]]) | ||||
| 	 dnl The below we need to know only if we are going to use the legacy AV api | ||||
| 	 FORK_CHECK_DECLS([av_buffersrc_add_frame_flags], | ||||
| 		[libavfilter/buffersrc.h]) | ||||
| 	 FORK_CHECK_DECLS([av_buffersink_get_frame], | ||||
| 		[libavfilter/buffersink.h]) | ||||
| 	 FORK_CHECK_DECLS([avfilter_graph_parse_ptr], | ||||
| 		[libavfilter/avfilter.h]) | ||||
| 	 FORK_CHECK_DECLS([av_packet_unref], | ||||
| 		[libavcodec/avcodec.h]) | ||||
| 	 FORK_CHECK_DECLS([av_packet_rescale_ts], | ||||
| 		[libavcodec/avcodec.h]) | ||||
| 	 FORK_CHECK_DECLS([avformat_alloc_output_context2], | ||||
| 		[libavformat/avformat.h]) | ||||
| 	 FORK_CHECK_DECLS([av_frame_alloc], | ||||
| 		[libavutil/frame.h]) | ||||
| 	 FORK_CHECK_DECLS([av_frame_get_best_effort_timestamp], | ||||
| 		[libavutil/frame.h]) | ||||
| 	 FORK_CHECK_DECLS([av_image_fill_arrays], | ||||
| 		[libavutil/imgutils.h]) | ||||
| 	 FORK_CHECK_DECLS([av_image_get_buffer_size], | ||||
| 		[libavutil/imgutils.h]) | ||||
| 	 AC_CHECK_HEADERS([libavutil/channel_layout.h libavutil/mathematics.h]) | ||||
| 	]) | ||||
| AM_CONDITIONAL([COND_FFMPEG_LEGACY], [[test "x$modern_av_apis" = "xno"]]) | ||||
| dnl Option to choose old ffmpeg/libav API even if modern api was found | ||||
| FORK_ARG_DISABLE([use of ffmpeg/libav API with avcodec_send_packet() and family], | ||||
| 	[avcodecsend], [USE_AVCODEC_SEND]) | ||||
| AM_CONDITIONAL([COND_FFMPEG_LEGACY], | ||||
| 	[[test "x$libav_modern_api" = "xno" || test "x$enable_avcodecsend" = "xno" ]]) | ||||
| 
 | ||||
| AC_CHECK_SIZEOF([void *]) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user