# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../vdr-softdevice/hotfix-ffmpeg.patch # Copyright (C) 2008 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- Modified Files: CHANGELOG configure mpeg2decoder.c Log Message: Fix build failure with newer ffmpeg releases (bug #14494). Index: CHANGELOG =================================================================== RCS file: /cvsroot/softdevice/softdevice/CHANGELOG,v retrieving revision 1.341 retrieving revision 1.342 diff -C2 -d -r1.341 -r1.342 *** ./CHANGELOG 12 Sep 2008 16:48:58 -0000 1.341 --- ./CHANGELOG 21 Sep 2008 12:55:57 -0000 1.342 *************** *** 1,3 **** --- 1,5 ---- Changelog + 2008-09-21: + - build: Fix build failure with newer ffmpeg releases (bug #14494). 2008-09-12: - OSD: next fix in subtitle vs. OSD behaviour issues. Index: configure =================================================================== RCS file: /cvsroot/softdevice/softdevice/configure,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ./configure 14 Jul 2008 17:03:03 -0000 1.49 --- ./configure 21 Sep 2008 12:55:57 -0000 1.50 *************** *** 402,405 **** --- 402,442 ---- ######################################################## + echo -n "Checking ffmpeg for member of AVCodecContext: error_recognition ... " + echo "Checking ffmpeg for member of AVCodecContext: error_recognition ----" >> config.log + + test_error_recognition() + { + has_error_recognition="yes"; + cat > ${TMPC} << EOF + #define __STDC_CONSTANT_MACROS + #include + extern "C" { + #include + #include + #include + } + int main(void) { + AVCodecContext *context; + + if (context -> error_recognition) + return 1; + return 0; + } + EOF + $cc $CFLAGS $ffmpeg_cflags $swscale_cflags -o $TMPE $TMPC $swscale_libs $ffmpeg_libs >> config.log 2>&1 || has_error_recognition="no" + $TMPE + }; + + ######################################################## + # check for error_recognition + test_error_recognition + if test "${has_error_recognition}" = "yes" ; then + echo " 'error_recognition' found" + else + echo " 'error_recognition' NOT found" + fi + + + ######################################################## # check for ALSA echo -n "Checking for ALSA sound... " *************** *** 930,933 **** --- 967,976 ---- if test "${swscale}" = "yes"; then echo "#define USE_SWSCALE" >> $TMPH + fi + + if test "${has_error_recognition}" = "yes" ; then + echo "#define HAS_ERROR_RECOGNITION 1" >> $TMPH + else + echo "#define HAS_ERROR_RECOGNITION 0" >> $TMPH fi Index: mpeg2decoder.c =================================================================== RCS file: /cvsroot/softdevice/softdevice/mpeg2decoder.c,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** ./mpeg2decoder.c 20 Jul 2008 16:41:01 -0000 1.83 --- ./mpeg2decoder.c 21 Sep 2008 12:55:57 -0000 1.84 *************** *** 141,145 **** --- 141,149 ---- context=Context; if (context) + #if HAS_ERROR_RECOGNITION + context->error_recognition=1; + #else context->error_resilience=1; + #endif CMDDEB("Neuer StreamDecoder Pid: %d context %p type %d\n", getpid(),context,context->codec_type ); *************** *** 1027,1032 **** cMpeg2Decoder::cMpeg2Decoder(cAudioOut *AudioOut, cVideoOut *VideoOut) { if ( avcodec_build() != LIBAVCODEC_BUILD ) { ! fprintf(stderr,"Fatal Error! Libavcodec library build(%d) doesn't match avcodec.h build(%d)!!!\n",avcodec_build(),LIBAVCODEC_BUILD); fprintf(stderr,"Check your ffmpeg installation / the pathes in the Makefile!!!\n"); exit(-1); --- 1031,1047 ---- cMpeg2Decoder::cMpeg2Decoder(cAudioOut *AudioOut, cVideoOut *VideoOut) { + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) if ( avcodec_build() != LIBAVCODEC_BUILD ) { ! fprintf(stderr, ! "Fatal Error! Libavcodec library build(%d) doesn't " ! "match avcodec.h build(%d)!!!\n", ! avcodec_build(), LIBAVCODEC_BUILD); ! #else ! if ( avcodec_version() != LIBAVCODEC_VERSION_INT ) { ! fprintf(stderr, ! "Fatal Error! Libavcodec library build(%d) doesn't " ! "match avcodec.h build(%d)!!!\n", ! avcodec_version(), LIBAVCODEC_VERSION_INT); ! #endif fprintf(stderr,"Check your ffmpeg installation / the pathes in the Makefile!!!\n"); exit(-1);