* added graalvm (22.0.0.1) - A high-performance JDK distribution
[t2.git] / package / vdr / vdr-softdevice / hotfix-ffmpeg.patch
blob839605073480aa35c87c5de40dc5e3d521b80eed
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../vdr-softdevice/hotfix-ffmpeg.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Modified Files:
18 CHANGELOG configure mpeg2decoder.c
19 Log Message:
20 Fix build failure with newer ffmpeg releases (bug #14494).
22 Index: CHANGELOG
23 ===================================================================
24 RCS file: /cvsroot/softdevice/softdevice/CHANGELOG,v
25 retrieving revision 1.341
26 retrieving revision 1.342
27 diff -C2 -d -r1.341 -r1.342
28 *** ./CHANGELOG 12 Sep 2008 16:48:58 -0000 1.341
29 --- ./CHANGELOG 21 Sep 2008 12:55:57 -0000 1.342
30 ***************
31 *** 1,3 ****
32 --- 1,5 ----
33 Changelog
34 + 2008-09-21:
35 + - build: Fix build failure with newer ffmpeg releases (bug #14494).
36 2008-09-12:
37 - OSD: next fix in subtitle vs. OSD behaviour issues.
39 Index: configure
40 ===================================================================
41 RCS file: /cvsroot/softdevice/softdevice/configure,v
42 retrieving revision 1.49
43 retrieving revision 1.50
44 diff -C2 -d -r1.49 -r1.50
45 *** ./configure 14 Jul 2008 17:03:03 -0000 1.49
46 --- ./configure 21 Sep 2008 12:55:57 -0000 1.50
47 ***************
48 *** 402,405 ****
49 --- 402,442 ----
51 ########################################################
52 + echo -n "Checking ffmpeg for member of AVCodecContext: error_recognition ... "
53 + echo "Checking ffmpeg for member of AVCodecContext: error_recognition ----" >> config.log
55 + test_error_recognition()
56 + {
57 + has_error_recognition="yes";
58 + cat > ${TMPC} << EOF
59 + #define __STDC_CONSTANT_MACROS
60 + #include <stdlib.h>
61 + extern "C" {
62 + #include <libavcodec/avcodec.h>
63 + #include <libavformat/avformat.h>
64 + #include <libswscale/swscale.h>
65 + }
66 + int main(void) {
67 + AVCodecContext *context;
69 + if (context -> error_recognition)
70 + return 1;
71 + return 0;
72 + }
73 + EOF
74 + $cc $CFLAGS $ffmpeg_cflags $swscale_cflags -o $TMPE $TMPC $swscale_libs $ffmpeg_libs >> config.log 2>&1 || has_error_recognition="no"
75 + $TMPE
76 + };
78 + ########################################################
79 + # check for error_recognition
80 + test_error_recognition
81 + if test "${has_error_recognition}" = "yes" ; then
82 + echo " 'error_recognition' found"
83 + else
84 + echo " 'error_recognition' NOT found"
85 + fi
88 + ########################################################
89 # check for ALSA
90 echo -n "Checking for ALSA sound... "
91 ***************
92 *** 930,933 ****
93 --- 967,976 ----
94 if test "${swscale}" = "yes"; then
95 echo "#define USE_SWSCALE" >> $TMPH
96 + fi
98 + if test "${has_error_recognition}" = "yes" ; then
99 + echo "#define HAS_ERROR_RECOGNITION 1" >> $TMPH
100 + else
101 + echo "#define HAS_ERROR_RECOGNITION 0" >> $TMPH
105 Index: mpeg2decoder.c
106 ===================================================================
107 RCS file: /cvsroot/softdevice/softdevice/mpeg2decoder.c,v
108 retrieving revision 1.83
109 retrieving revision 1.84
110 diff -C2 -d -r1.83 -r1.84
111 *** ./mpeg2decoder.c 20 Jul 2008 16:41:01 -0000 1.83
112 --- ./mpeg2decoder.c 21 Sep 2008 12:55:57 -0000 1.84
113 ***************
114 *** 141,145 ****
115 --- 141,149 ----
116 context=Context;
117 if (context)
118 + #if HAS_ERROR_RECOGNITION
119 + context->error_recognition=1;
120 + #else
121 context->error_resilience=1;
122 + #endif
123 CMDDEB("Neuer StreamDecoder Pid: %d context %p type %d\n",
124 getpid(),context,context->codec_type );
125 ***************
126 *** 1027,1032 ****
127 cMpeg2Decoder::cMpeg2Decoder(cAudioOut *AudioOut, cVideoOut *VideoOut)
129 if ( avcodec_build() != LIBAVCODEC_BUILD ) {
130 ! fprintf(stderr,"Fatal Error! Libavcodec library build(%d) doesn't match avcodec.h build(%d)!!!\n",avcodec_build(),LIBAVCODEC_BUILD);
131 fprintf(stderr,"Check your ffmpeg installation / the pathes in the Makefile!!!\n");
132 exit(-1);
133 --- 1031,1047 ----
134 cMpeg2Decoder::cMpeg2Decoder(cAudioOut *AudioOut, cVideoOut *VideoOut)
136 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
137 if ( avcodec_build() != LIBAVCODEC_BUILD ) {
138 ! fprintf(stderr,
139 ! "Fatal Error! Libavcodec library build(%d) doesn't "
140 ! "match avcodec.h build(%d)!!!\n",
141 ! avcodec_build(), LIBAVCODEC_BUILD);
142 ! #else
143 ! if ( avcodec_version() != LIBAVCODEC_VERSION_INT ) {
144 ! fprintf(stderr,
145 ! "Fatal Error! Libavcodec library build(%d) doesn't "
146 ! "match avcodec.h build(%d)!!!\n",
147 ! avcodec_version(), LIBAVCODEC_VERSION_INT);
148 ! #endif
149 fprintf(stderr,"Check your ffmpeg installation / the pathes in the Makefile!!!\n");
150 exit(-1);