[SCM] lives/master: Replace 03-libav9.patch with patch from upstream
sramacher at users.alioth.debian.org
sramacher at users.alioth.debian.org
Fri Nov 29 19:14:52 UTC 2013
The following commit has been merged in the master branch:
commit 35b548cc2aff5713d1d5488b60db874d5831d9a8
Author: Sebastian Ramacher <sramacher at debian.org>
Date: Fri Nov 29 19:02:56 2013 +0100
Replace 03-libav9.patch with patch from upstream
diff --git a/debian/patches/03-libav9.patch b/debian/patches/03-libav9.patch
index f12e016..6063433 100644
--- a/debian/patches/03-libav9.patch
+++ b/debian/patches/03-libav9.patch
@@ -1,16 +1,624 @@
-Description: Fix compilation with libav 9
-Author: Sebastian Ramacher <sramacher at debian.org>
-Bug-Debian: http://bugs.debian.org/720805
-Last-Update: 2013-08-27
+Description: Fix comilation with libav 9
+Origin: upstream
+Last-Update: 2013-11-29
---- lives-2.0.5~ds0.orig/lives-plugins/plugins/decoders/mpegts_decoder.c
-+++ lives-2.0.5~ds0/lives-plugins/plugins/decoders/mpegts_decoder.c
-@@ -69,7 +69,7 @@ const char *plugin_version="LiVES mpegts
- # define offsetof(T, F) ((unsigned int)((char *)&((T *)0)->F))
+--- a/lives-plugins/plugins/decoders/asf_decoder.c
++++ b/lives-plugins/plugins/decoders/asf_decoder.c
+@@ -30,6 +30,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <ctype.h>
+ #ifndef IS_MINGW
+ #ifndef IS_SOLARIS
+ #include <endian.h>
+@@ -57,11 +58,36 @@
+ #endif
+
+ #include <libavformat/avformat.h>
++#include <libavcodec/version.h>
+ #include <libavutil/avstring.h>
+
+ #include "decplugin.h"
+ #include "asf_decoder.h"
+
++#if (LIBAVCODEC_VERSION_MAJOR > 54)
++#define CodecID AVCodecID
++#define CODEC_ID_NONE AV_CODEC_ID_NONE
++#define CODEC_ID_WMV1 AV_CODEC_ID_WMV1
++#define CODEC_ID_WMV2 AV_CODEC_ID_WMV2
++#define CODEC_ID_WMV3 AV_CODEC_ID_WMV3
++#define CODEC_ID_DVVIDEO AV_CODEC_ID_DVVIDEO
++#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
++#define CODEC_ID_H264 AV_CODEC_ID_H264
++#define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO
++#define CODEC_ID_MPEG2VIDEO AV_CODEC_ID_MPEG2VIDEO
++#endif
++
++#if !HAVE_AVCODEC_OPEN2
++#define avcodec_open2(a, b, c) avcodec_open(a, b)
++#endif
++
++#if HAVE_AVFORMAT_NEW_STREAM
++#define av_new_stream(a, b) avformat_new_stream(a, NULL)
++#endif
++
++#if HAVE_AVPRIV_SET_PTS_INFO
++#define av_set_pts_info(a,b,c,d) avpriv_set_pts_info(a,b,c,d)
++#endif
+
+ static enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
+ {
+@@ -2003,7 +2029,8 @@
+ return FALSE;
+ }
+
+- if ((retval=avcodec_open(vidst->codec, codec)) < 0) {
++
++ if ((retval=avcodec_open2(vidst->codec, codec, NULL)) < 0) {
+ fprintf(stderr, "asf_decoder: Could not open avcodec context (%d) %d\n",retval,vidst->codec->frame_number);
+ detach_stream(cdata);
+ return FALSE;
+@@ -2323,6 +2350,9 @@
+ cdata->asigned=TRUE;
+ cdata->ainterleaf=TRUE;
+
++ av_free(priv->picture);
++ priv->picture=NULL;
++
+ return cdata;
+ }
+
+@@ -2378,18 +2408,23 @@
+ boolean get_frame(const lives_clip_data_t *cdata, int64_t tframe, int *rowstrides, int height, void **pixel_data) {
+ // seek to frame,
+
+- int64_t nextframe=0;
+- int tfrag=0;
+ lives_asf_priv_t *priv=cdata->priv;
++
++ int64_t nextframe=0;
+ int64_t target_pts=frame_to_dts(cdata,tframe);
++
++ unsigned char *dst,*src;
++ unsigned char black[4]={0,0,0,255};
++
++ boolean got_picture=FALSE;
++
++ int tfrag=0;
+ int xheight=cdata->frame_height,pal=cdata->current_palette,nplanes=1,dstwidth=cdata->width,psize=1;
+ int btop=cdata->offs_y,bbot=xheight-1-btop;
+ int bleft=cdata->offs_x,bright=cdata->frame_width-cdata->width-bleft;
+ int rescan_limit=16; // pick some arbitrary value
+ int y_black=(cdata->YUV_clamping==WEED_YUV_CLAMPING_CLAMPED)?16:0;
+- boolean got_picture=FALSE;
+- unsigned char *dst,*src;
+- unsigned char black[4]={0,0,0,255};
++
+ register int i,p;
+
+ #ifdef DEBUG_KFRAMES
+@@ -2414,7 +2449,8 @@
+
+ if (pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) psize=3;
+
+- if (pal==WEED_PALETTE_RGBA32||pal==WEED_PALETTE_BGRA32||pal==WEED_PALETTE_ARGB32||pal==WEED_PALETTE_UYVY8888||pal==WEED_PALETTE_YUYV8888||pal==WEED_PALETTE_YUV888||pal==WEED_PALETTE_YUVA8888) psize=4;
++ if (pal==WEED_PALETTE_RGBA32||pal==WEED_PALETTE_BGRA32||pal==WEED_PALETTE_ARGB32||pal==WEED_PALETTE_UYVY8888||
++ pal==WEED_PALETTE_YUYV8888||pal==WEED_PALETTE_YUV888||pal==WEED_PALETTE_YUVA8888) psize=4;
+
+ if (pal==WEED_PALETTE_YUV411) psize=6;
+
+@@ -2470,6 +2506,7 @@
+ priv->ctx->skip_frame=AVDISCARD_NONREF;
+
+ priv->last_frame=tframe;
++ if (priv->picture==NULL) priv->picture = avcodec_alloc_frame();
+
+
+ // do this until we reach target frame //////////////
+@@ -2520,7 +2557,7 @@
+
+ }
+
+- if (pixel_data==NULL) return TRUE;
++ if (priv->picture==NULL||pixel_data==NULL) return TRUE;
+
+ if (priv->black_fill) btop=cdata->frame_height;
+
+@@ -2531,7 +2568,8 @@
+ for (i=0;i<xheight;i++) {
+ if (i<btop||i>bbot) {
+ // top or bottom border, copy black row
+- if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
++ if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||
++ pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
+ memset(dst,black[p],dstwidth+(bleft+bright)*psize);
+ dst+=dstwidth+(bleft+bright)*psize;
+ }
+@@ -2540,7 +2578,8 @@
+ }
+
+ if (bleft>0) {
+- if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
++ if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||
++ pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
+ memset(dst,black[p],bleft*psize);
+ dst+=bleft*psize;
+ }
+@@ -2551,7 +2590,8 @@
+ dst+=dstwidth;
+
+ if (bright>0) {
+- if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
++ if (pal==WEED_PALETTE_YUV420P||pal==WEED_PALETTE_YVU420P||pal==WEED_PALETTE_YUV422P||pal==WEED_PALETTE_YUV444P||
++ pal==WEED_PALETTE_YUVA4444P||pal==WEED_PALETTE_RGB24||pal==WEED_PALETTE_BGR24) {
+ memset(dst,black[p],bright*psize);
+ dst+=bright*psize;
+ }
+--- a/lives-plugins/plugins/decoders/flv_decoder.c
++++ b/lives-plugins/plugins/decoders/flv_decoder.c
+@@ -59,10 +59,29 @@
+ #include <libavformat/avformat.h>
+ #include <libavutil/avstring.h>
+ #include <libavcodec/avcodec.h>
++#include <libavcodec/version.h>
+
+ #include "decplugin.h"
+ #include "flv_decoder.h"
+
++
++#if (LIBAVCODEC_VERSION_MAJOR > 54)
++#define CodecID AVCodecID
++#define CODEC_ID_NONE AV_CODEC_ID_NONE
++#define CODEC_ID_FLV1 AV_CODEC_ID_FLV1
++#define CODEC_ID_FLASHSV AV_CODEC_ID_FLASHSV
++#define CODEC_ID_FLASHSV2 AV_CODEC_ID_FLASHSV2
++#define CODEC_ID_VP6A AV_CODEC_ID_VP6A
++#define CODEC_ID_VP6F AV_CODEC_ID_VP6F
++#define CODEC_ID_H264 AV_CODEC_ID_H264
++#endif
++
++#if !HAVE_AVCODEC_OPEN2
++#define avcodec_open2(a, b, c) avcodec_open(a, b)
++#endif
++
++
++
+ ////////////////////////////////////////////////////////////////////////////
+
+
+@@ -528,7 +547,7 @@
+ double num_val,fps;
+
+ AVCodec *codec=NULL;
+- AVCodecContext *ctx;
++ AVCodecContext *ctx=NULL;
+
+ boolean got_picture=FALSE,got_avcextradata=FALSE;
+
+@@ -754,7 +773,7 @@
+
+ if (!hasaudio) got_astream=TRUE;
+
+- priv->ctx=ctx = avcodec_alloc_context();
++ priv->ctx = NULL;
+
+ sprintf(cdata->audio_name,"%s","");
+
+@@ -883,6 +902,9 @@
+ priv->pack_offset=2;
+ break;
+ case FLV_CODECID_VP6A :
++ codec = avcodec_find_decoder(CODEC_ID_VP6A);
++ priv->ctx = ctx = avcodec_alloc_context3(codec);
++
+ sprintf(cdata->video_name,"%s","vp6a");
+ cdata->offs_x=(pack.data[1]&0X0F)>>1; // divide by 2 for offset
+ cdata->offs_y=(pack.data[1]&0XF0)>>5; // divide by 2 for offset
+@@ -894,7 +916,6 @@
+ }
+ ctx->extradata[0] = pack.data[1];
+
+- codec = avcodec_find_decoder(CODEC_ID_VP6A);
+ priv->pack_offset=2;
+ break;
+ case FLV_CODECID_H264:
+@@ -915,6 +936,8 @@
+
+ }
+
++
++
+ #ifdef DEBUG
+ fprintf(stderr,"video type is %s %d x %d (%d x %d +%d +%d)\n",cdata->video_name,
+ cdata->width,cdata->height,cdata->frame_width,cdata->frame_height,cdata->offs_x,cdata->offs_y);
+@@ -928,7 +951,10 @@
+ return FALSE;
+ }
+
+- if (avcodec_open(ctx, codec) < 0) {
++ if (ctx==NULL)
++ priv->ctx = ctx = avcodec_alloc_context3(codec);
++
++ if (avcodec_open2(ctx, codec, NULL) < 0) {
+ fprintf(stderr, "flv_decoder: Could not open avcodec context\n");
+ detach_stream(cdata);
+ return FALSE;
+@@ -1309,6 +1335,9 @@
+ cdata->asigned=TRUE;
+ cdata->ainterleaf=TRUE;
+
++ av_free(priv->picture);
++ priv->picture=NULL;
++
+ return cdata;
+ }
+
+@@ -1451,6 +1480,7 @@
+ priv->ctx->skip_frame=AVDISCARD_NONREF;
+
+ priv->last_frame=tframe;
++ if (priv->picture==NULL) priv->picture = avcodec_alloc_frame();
+
+
+ // do this until we reach target frame //////////////
+@@ -1520,7 +1550,7 @@
+
+ }
+
+- if (pixel_data==NULL) return TRUE;
++ if (priv->picture==NULL||pixel_data==NULL) return TRUE;
+
+ for (p=0;p<nplanes;p++) {
+ dst=pixel_data[p];
+--- a/lives-plugins/plugins/decoders/mkv_decoder.c
++++ b/lives-plugins/plugins/decoders/mkv_decoder.c
+@@ -36,6 +36,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <ctype.h>
+ #include <sys/stat.h>
+
+ const char *plugin_version="LiVES mkv decoder version 1.2";
+@@ -63,17 +64,60 @@
+
+ #include <libavformat/avformat.h>
+ #include <libavutil/avstring.h>
++#include <libavcodec/version.h>
+ #include <libavutil/mem.h>
+
+ #include "decplugin.h"
+
+-#include "mkv_decoder.h"
+-
+ #include <libavutil/intfloat_readwrite.h>
+ #include <libavutil/intreadwrite.h>
+ #include <libavutil/lzo.h>
+ #include <libavutil/dict.h>
+
++
++#if (LIBAVCODEC_VERSION_MAJOR > 54)
++#define CodecID AVCodecID
++#define CODEC_ID_NONE AV_CODEC_ID_NONE
++#define CODEC_ID_TEXT AV_CODEC_ID_TEXT
++#define CODEC_ID_SSA AV_CODEC_ID_SSA
++#define CODEC_ID_VP8 AV_CODEC_ID_VP8
++#define CODEC_ID_THEORA AV_CODEC_ID_THEORA
++#define CODEC_ID_SNOW AV_CODEC_ID_SNOW
++#define CODEC_ID_DIRAC AV_CODEC_ID_DIRAC
++#define CODEC_ID_MJPEG AV_CODEC_ID_MJPEG
++#define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO
++#define CODEC_ID_MPEG2VIDEO AV_CODEC_ID_MPEG2VIDEO
++#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
++#define CODEC_ID_H264 AV_CODEC_ID_H264
++#define CODEC_ID_MSMPEG4V3 AV_CODEC_ID_MSMPEG4V3
++#define CODEC_ID_RV10 AV_CODEC_ID_RV10
++#define CODEC_ID_RV20 AV_CODEC_ID_RV20
++#define CODEC_ID_RV30 AV_CODEC_ID_RV30
++#define CODEC_ID_RV40 AV_CODEC_ID_RV40
++#define CODEC_ID_RAWVIDEO AV_CODEC_ID_RAWVIDEO
++#endif
++
++
++#if !HAVE_AVCODEC_OPEN2
++#define avcodec_open2(a, b, c) avcodec_open(a, b)
++#endif
++
++#if !HAVE_AVCODEC_ALLOC_CONTEXT3
++#define avcodec_alloc_context3(a) avcodec_alloc_context()
++#endif
++
++#if HAVE_AVFORMAT_NEW_STREAM
++#define av_new_stream(a, b) avformat_new_stream(a, NULL)
++#endif
++
++#if HAVE_AVPRIV_SET_PTS_INFO
++#define av_set_pts_info(a,b,c,d) avpriv_set_pts_info(a,b,c,d)
++#endif
++
++
++#include "mkv_decoder.h"
++
++
+ #if CONFIG_ZLIB
+ #include <zlib.h>
+ #endif
+@@ -96,7 +140,6 @@
+ };
+
+
+-
+ static enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
+ {
+ int i;
+@@ -1748,9 +1791,9 @@
+ return FALSE;
+ }
+
+- priv->ctx = ctx = avcodec_alloc_context();
++ priv->ctx = ctx = avcodec_alloc_context3(codec);
+
+- if (avcodec_open(ctx, codec) < 0) {
++ if (avcodec_open2(ctx, codec, NULL) < 0) {
+ fprintf(stderr, "mkv_decoder: Could not open avcodec context for codec\n");
+ detach_stream(cdata);
+ return FALSE;
+@@ -2076,6 +2119,9 @@
+ cdata->asigned=TRUE;
+ cdata->ainterleaf=TRUE;
+
++ av_free(priv->picture);
++ priv->picture=NULL;
++
+ return cdata;
+ }
+
+@@ -2604,6 +2650,7 @@
+ //priv->ctx->skip_frame=AVDISCARD_NONREF;
+
+ priv->last_frame=tframe;
++ if (priv->picture==NULL) priv->picture = avcodec_alloc_frame();
+
+ // do this until we reach target frame //////////////
+
+@@ -2640,7 +2687,7 @@
+
+ }
+
+- if (pixel_data==NULL) return TRUE;
++ if (priv->picture==NULL||pixel_data==NULL) return TRUE;
+
+ for (p=0;p<nplanes;p++) {
+ dst=pixel_data[p];
+--- a/lives-plugins/plugins/decoders/mpegts_decoder.c
++++ b/lives-plugins/plugins/decoders/mpegts_decoder.c
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <ctype.h>
+ #include <sys/stat.h>
+
+ #ifndef IS_MINGW
+@@ -55,27 +56,63 @@
+
+ #include "decplugin.h"
+
++
+ #include <libavformat/avformat.h>
+ #include <libavutil/opt.h>
+ #include <libavutil/crc.h>
+ #include <libavutil/avstring.h>
+ #include <libavutil/mem.h>
+ #include <libavcodec/avcodec.h>
++#include <libavcodec/version.h>
+
+ #include "mpegts_decoder.h"
+
+
++#if ((LIBAVUTIL_VERSION_MAJOR < 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR < 22))
++#define AV_OPT_TYPE_INT FF_OPT_TYPE_INT
++#endif
++
+ #ifndef offsetof
+-# define offsetof(T, F) ((unsigned int)((char *)&((T *)0)->F))
++#define offsetof(T, F) ((unsigned int)((char *)&((T *)0)->F))
#endif
-#ifndef AV_OPT_TYPE_INT
-+#if LIBAVUTIL_VERSION_MAJOR < 52 && !defined(AV_OPT_TYPE_INT)
- #define AV_OPT_TYPE_INT FF_OPT_TYPE_INT
+-#define AV_OPT_TYPE_INT FF_OPT_TYPE_INT
++
++#if (LIBAVCODEC_VERSION_MAJOR > 54)
++#define CodecID AVCodecID
++#define CODEC_ID_NONE AV_CODEC_ID_NONE
++#define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO
++#define CODEC_ID_MPEG2VIDEO AV_CODEC_ID_MPEG2VIDEO
++#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
++#define CODEC_ID_H264 AV_CODEC_ID_H264
++#define CODEC_ID_DIRAC AV_CODEC_ID_DIRAC
++#define CODEC_ID_MP3 AV_CODEC_ID_MP3
++#define CODEC_ID_AAC AV_CODEC_ID_AAC
++#define CODEC_ID_VC1 AV_CODEC_ID_VC1
++#define CODEC_ID_PCM_BLURAY AV_CODEC_ID_PCM_BLURAY
++#define CODEC_ID_AC3 AV_CODEC_ID_AC3
++#define CODEC_ID_EAC3 AV_CODEC_ID_EAC3
++#define CODEC_ID_DTS AV_CODEC_ID_DTS
++#define CODEC_ID_TRUEHD AV_CODEC_ID_TRUEHD
++#define CODEC_ID_S302M AV_CODEC_ID_S302M
++#define CODEC_ID_DVB_TELETEXT AV_CODEC_ID_DVB_TELETEXT
++#define CODEC_ID_DVB_SUBTITLE AV_CODEC_ID_DVB_SUBTITLE
#endif
++#if !HAVE_AVCODEC_OPEN2
++#define avcodec_open2(a, b, c) avcodec_open(a, b)
++#endif
+
++#if !HAVE_AVCODEC_ALLOC_CONTEXT3
++#define avcodec_alloc_context3(a) avcodec_alloc_context()
++#endif
+
++#if HAVE_AVFORMAT_NEW_STREAM
++#define av_new_stream(a, b) avformat_new_stream(a, NULL)
++#endif
+
++#if HAVE_AVPRIV_SET_PTS_INFO
++#define av_set_pts_info(a,b,c,d) avpriv_set_pts_info(a,b,c,d)
++#endif
+
+ /**
+ * Read 1-25 bits.
+@@ -1009,6 +1046,7 @@
+ memcpy(sub_pes, pes, sizeof(*sub_pes));
+
+ sub_st = av_new_stream(pes->stream, pes->pid);
++
+ if (!sub_st) {
+ av_free(sub_pes);
+ return AVERROR(ENOMEM);
+@@ -3064,9 +3102,9 @@
+ return FALSE;
+ }
+
+- priv->ctx = ctx = avcodec_alloc_context();
++ priv->ctx = ctx = avcodec_alloc_context3(codec);
+
+- if (avcodec_open(ctx, codec) < 0) {
++ if (avcodec_open2(ctx, codec, NULL) < 0) {
+ fprintf(stderr, "mpegts_decoder: Could not open avcodec context\n");
+ detach_stream(cdata);
+ return FALSE;
+@@ -3292,6 +3330,9 @@
+ fprintf(stderr,"fps is %.4f %ld %ld %ld\n",cdata->fps,cdata->nframes,ldts,priv->start_dts);
+ #endif
+
++ av_free(priv->picture);
++ priv->picture=NULL;
++
+ return TRUE;
+ }
+
+@@ -3517,6 +3558,7 @@
+ //priv->ctx->skip_frame=AVDISCARD_NONREF;
+
+ priv->last_frame=tframe;
++ if (priv->picture==NULL) priv->picture = avcodec_alloc_frame();
+
+ // do this until we reach target frame //////////////
+
+@@ -3554,7 +3596,7 @@
+
+ }
+
+- if (pixel_data==NULL) return TRUE;
++ if (priv->picture==NULL||pixel_data==NULL) return TRUE;
+
+ for (p=0;p<nplanes;p++) {
+ dst=pixel_data[p];
+--- a/lives-plugins/plugins/decoders/Makefile.am
++++ b/lives-plugins/plugins/decoders/Makefile.am
+@@ -64,30 +64,42 @@
+
+ endif
+
+-# TODO - at least mpegps, mp4, mov, mng
+-# provided they support frame accurate seeking
+-
+-# avi is broken and needs a patch for decoding
+-
+-# h264 does not work and needs a patch
+
+
+ if HAVE_AVFORMAT
+ if HAVE_AVCODEC
+ if HAVE_AVUTIL
+
++libav_cflags =
++
++if HAVE_AVCODEC_OPEN2
++libav_cflags += -DHAVE_AVCODEC_OPEN2=1
++endif
++
++if HAVE_AVCODEC_ALLOC_CONTEXT3
++libav_cflags += -DHAVE_AVCODEC_ALLOC_CONTEXT3=1
++endif
++
++if HAVE_AVFORMAT_NEW_STREAM
++libav_cflags += -DHAVE_AVFORMAT_NEW_STREAM=1
++endif
++
++if HAVE_AVPRIV_SET_PTS_INFO
++libav_cflags += -DHAVE_AVPRIV_SET_PTS_INFO=1
++endif
++
+ flv_libs = flv_decoder.la
+ FLVDEC_LIBS = @LIBAVCODEC_LIBS@ @LIBAVFORMAT_LIBS@
+ FLVDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ -Wno-deprecated-declarations
+ flv_decoder_la_SOURCES = flv_decoder.c flv_decoder.h
+-flv_decoder_la_CFLAGS = $(shared_cflags) $(weed_cflags) $(FLVDEC_CFLAGS)
++flv_decoder_la_CFLAGS = $(libav_cflags) $(shared_cflags) $(weed_cflags) $(FLVDEC_CFLAGS)
+ flv_decoder_la_LDFLAGS = $(shared_ldflags) $(FLVDEC_LIBS)
+
+ asf_libs = asf_decoder.la
+ ASFDEC_LIBS = @LIBAVCODEC_LIBS@ @LIBAVFORMAT_LIBS@
+ ASFDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ -Wno-deprecated-declarations
+ asf_decoder_la_SOURCES = asf_decoder.c asf_decoder.h
+-asf_decoder_la_CFLAGS = $(shared_cflags) $(weed_cflags) $(ASFDEC_CFLAGS)
++asf_decoder_la_CFLAGS = $(libav_cflags) $(shared_cflags) $(weed_cflags) $(ASFDEC_CFLAGS)
+ asf_decoder_la_LDFLAGS = $(shared_ldflags) $(ASFDEC_LIBS)
+
+
+@@ -96,7 +108,7 @@
+ MKVDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ @LIBZ_CFLAGS@ @LIBBZ_CFLAGS@ \
+ -Wno-deprecated-declarations
+ mkv_decoder_la_SOURCES = mkv_decoder.c mkv_decoder.h
+-mkv_decoder_la_CFLAGS = $(shared_cflags) $(weed_cflags) $(MKVDEC_CFLAGS)
++mkv_decoder_la_CFLAGS = $(libav_cflags) $(shared_cflags) $(weed_cflags) $(MKVDEC_CFLAGS)
+ mkv_decoder_la_LDFLAGS = $(shared_ldflags) $(MKVDEC_LIBS)
+
+
+@@ -106,7 +118,7 @@
+ MPEGTSDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ \
+ -Wno-deprecated-declarations
+ mpegts_decoder_la_SOURCES = mpegts_decoder.c mpegts_decoder.h
+-mpegts_decoder_la_CFLAGS = $(shared_cflags) $(weed_cflags) $(MPEGTSDEC_CFLAGS)
++mpegts_decoder_la_CFLAGS = $(libav_cflags) $(shared_cflags) $(weed_cflags) $(MPEGTSDEC_CFLAGS)
+ mpegts_decoder_la_LDFLAGS = $(shared_ldflags) $(MPEGTSDEC_LIBS)
+
+
+--- a/configure.in
++++ b/configure.in
+@@ -451,6 +451,33 @@
+ AM_CONDITIONAL(HAVE_SWSCALE,$HAVE_SWSCALE)
+
+
++HAVE_AVCODEC_OPEN2=false
++HAVE_AVCODEC_ALLOC_CONTEXT3=false
++HAVE_AVFORMAT_NEW_STREAM=false
++HAVE_AVPRIV_SET_PTS_INFO=false
++
++if test "$HAVE_AVCODEC" = "true" ; then
++AC_CHECK_LIB(avcodec,avcodec_open2,HAVE_AVCODEC_OPEN2=true,HAVE_AVCODEC_OPEN2=false)
++AC_CHECK_LIB(avcodec,avcodec_alloc_context3,HAVE_AVCODEC_ALLOC_CONTEXT3=true,HAVE_AVCODEC_ALLOC_COBTEXT3=false)
++fi
++
++if test "$HAVE_AVFORMAT" = "true" ; then
++AC_CHECK_LIB(avformat,avformat_new_stream,HAVE_AVFORMAT_NEW_STREAM=true,HAVE_AVFORMAT_NEW_STREAM=false)
++AC_CHECK_HEADERS(libavformat/internal.h,HAVE_AVFORMAT_INTERNAL_H=true,HAVE_AVFORMAT_INTERNAL_H=false)
++
++if test "$HAVE_AVFORMAT_INTERNAL_H" = "true"; then
++AC_CHECK_LIB(avformat,avpriv_set_pts_info,HAVE_AVPRIV_SET_PTS_INFO=true,HAVE_AVPRIV_SET_PTS_INFO=false)
++fi
++
++fi
++
++AM_CONDITIONAL(HAVE_AVCODEC_OPEN2,$HAVE_AVCODEC_OPEN2)
++AM_CONDITIONAL(HAVE_AVCODEC_ALLOC_CONTEXT3,$HAVE_AVCODEC_ALLOC_CONTEXT3)
++AM_CONDITIONAL(HAVE_AVFORMAT_NEW_STREAM,$HAVE_AVFORMAT_NEW_STREAM)
++AM_CONDITIONAL(HAVE_AVPRIV_SET_PTS_INFO,$HAVE_AVPRIV_SET_PTS_INFO)
++
++
++
+ HAVE_OPENCV=false
+
+ dnl check for opencv
--
lives packaging
More information about the pkg-multimedia-commits
mailing list