File: FFmpeg-5.0-compatibility.patch

package info (click to toggle)
libam7xxx 0.1.7-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 580 kB
  • sloc: ansic: 2,336; xml: 40; sh: 27; makefile: 6
file content (46 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Description: Fix build against FFmpeg 5.0
Author: Nicholas Guriev <guriev-ns@ya.ru>
Bug-Debian: https://bugs.debian.org/1004821
Last-Update: Tue, 28 Jun 2022 23:33:19 +0300

--- a/examples/am7xxx-play.c
+++ b/examples/am7xxx-play.c
@@ -29,6 +29,7 @@
 #include <signal.h>
 #include <getopt.h>
 
+#include <libavcodec/avcodec.h>
 #include <libavdevice/avdevice.h>
 #include <libavformat/avformat.h>
 #include <libavutil/imgutils.h>
@@ -49,17 +50,19 @@ static int video_input_init(struct video
 			    const char *input_path,
 			    AVDictionary **input_options)
 {
-	AVInputFormat *input_format = NULL;
+	AVInputFormat const *input_format = NULL;
 	AVFormatContext *input_format_ctx;
 	AVCodecParameters *input_codec_params;
 	AVCodecContext *input_codec_ctx;
-	AVCodec *input_codec;
+	AVCodec const *input_codec;
 	int video_index;
 	int ret;
 
 	avdevice_register_all();
+#if LIBAVCODEC_VERSION_MAJOR < 59
 	avcodec_register_all();
 	av_register_all();
+#endif
 
 	if (input_format_string) {
 		/* find the desired input format */
@@ -158,7 +161,7 @@ static int video_output_init(struct vide
 			     am7xxx_device *dev)
 {
 	AVCodecContext *output_codec_ctx;
-	AVCodec *output_codec;
+	AVCodec const *output_codec;
 	unsigned int new_output_width;
 	unsigned int new_output_height;
 	int ret;