[SCM] lives/master: Refresh patches, remove 03-libav9.patch as it is applied upstream.
alessio at users.alioth.debian.org
alessio at users.alioth.debian.org
Mon Dec 2 09:53:11 UTC 2013
The following commit has been merged in the master branch:
commit da063e68d8c2ee738ef348651018d75caa19d1fd
Author: Alessio Treglia <alessio at debian.org>
Date: Mon Dec 2 09:33:11 2013 +0000
Refresh patches, remove 03-libav9.patch as it is applied upstream.
diff --git a/debian/patches/01-cdda2wav_to_icedax.patch b/debian/patches/01-cdda2wav_to_icedax.patch
index 3d084e2..b450e2b 100644
--- a/debian/patches/01-cdda2wav_to_icedax.patch
+++ b/debian/patches/01-cdda2wav_to_icedax.patch
@@ -24,7 +24,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
--- lives.orig/smogrify
+++ lives/smogrify
-@@ -3537,9 +3537,9 @@ if (defined($ARGV[0])) {
+@@ -3538,9 +3538,9 @@ if (defined($ARGV[0])) {
if ($command eq "cdopen") {
@@ -37,7 +37,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
}
$cdplay_device=&rc_get("cdplay_device");
-@@ -3554,7 +3554,7 @@ if (defined($ARGV[0])) {
+@@ -3555,7 +3555,7 @@ if (defined($ARGV[0])) {
unlink "$audiofile";
}
@@ -48,7 +48,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
sig_system_error("$com",$smerr);
--- lives.orig/src/gui.c
+++ lives/src/gui.c
-@@ -1199,7 +1199,7 @@ void create_LiVES (void) {
+@@ -1213,7 +1213,7 @@ void create_LiVES (void) {
lives_container_add (LIVES_CONTAINER (audio_menu), mainw->eject_cd);
if (capable->smog_version_correct) {
@@ -57,7 +57,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
lives_widget_set_sensitive (mainw->load_cdtrack, FALSE);
lives_widget_set_sensitive (mainw->eject_cd, FALSE);
}
-@@ -2825,7 +2825,7 @@ void create_LiVES (void) {
+@@ -2862,7 +2862,7 @@ void create_LiVES (void) {
g_signal_connect (GTK_OBJECT (mainw->load_audio), "activate",
G_CALLBACK (on_load_audio_activate),
NULL);
@@ -68,7 +68,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
NULL);
--- lives.orig/src/main.c
+++ lives/src/main.c
-@@ -1726,8 +1726,8 @@ void do_start_messages(void) {
+@@ -1747,8 +1747,8 @@ void do_start_messages(void) {
else d_print(_ ("composite...NOT DETECTED..."));
if (capable->has_sox_sox) d_print(_ ("sox...detected\n"));
else d_print(_ ("sox...NOT DETECTED\n"));
@@ -79,7 +79,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
if (capable->has_jackd) d_print(_ ("jackd...detected..."));
else d_print(_ ("jackd...NOT DETECTED..."));
if (capable->has_pulse_audio) d_print(_ ("pulse audio...detected..."));
-@@ -2011,7 +2011,7 @@ capability *get_capabilities (void) {
+@@ -2039,7 +2039,7 @@ capability *get_capabilities (void) {
capable->has_sox_play=FALSE;
capable->has_sox_sox=FALSE;
capable->has_dvgrab=FALSE;
@@ -88,7 +88,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
capable->has_autolives=FALSE;
capable->has_jackd=FALSE;
capable->has_gdb=FALSE;
-@@ -2171,8 +2171,8 @@ capability *get_capabilities (void) {
+@@ -2199,8 +2199,8 @@ capability *get_capabilities (void) {
get_location("dvgrab",string,256);
if (strlen(string)) capable->has_dvgrab=TRUE;
@@ -99,7 +99,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
get_location("jackd",string,256);
if (strlen(string)) capable->has_jackd=TRUE;
-@@ -3125,7 +3125,7 @@ void sensitize(void) {
+@@ -3153,7 +3153,7 @@ void sensitize(void) {
lives_widget_set_sensitive (mainw->load_audio, TRUE);
lives_widget_set_sensitive (mainw->load_subs, mainw->current_file>0);
lives_widget_set_sensitive (mainw->erase_subs, mainw->current_file>0&&cfile->subt!=NULL);
@@ -110,7 +110,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
lives_widget_set_sensitive (mainw->resample_video, mainw->current_file>0&&cfile->frames>0);
--- lives.orig/src/main.h
+++ lives/src/main.h
-@@ -678,7 +678,7 @@ typedef struct {
+@@ -679,7 +679,7 @@ typedef struct {
boolean has_convert;
boolean has_composite;
boolean has_identify;
@@ -121,7 +121,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
boolean has_pulse_audio;
--- lives.orig/src/preferences.c
+++ lives/src/preferences.c
-@@ -973,7 +973,7 @@ lives_toggle_button_get_active(LIVES_TOG
+@@ -981,7 +981,7 @@ lives_toggle_button_get_active(LIVES_TOG
}
// cd play device
@@ -130,7 +130,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
if (strcmp(prefs->cdplay_device,cdplay_device)) {
g_snprintf(prefs->cdplay_device,256,"%s",cdplay_device);
set_pref("cdplay_device",prefs->cdplay_device);
-@@ -1846,7 +1846,7 @@ void on_prefDomainChanged(GtkTreeSelecti
+@@ -1856,7 +1856,7 @@ void on_prefDomainChanged(GtkTreeSelecti
case LIST_ENTRY_MISC:
lives_widget_show_all(prefsw->scrollw_right_misc);
prefsw->right_shown = prefsw->scrollw_right_misc;
@@ -139,7 +139,7 @@ Author: Harry Rickards <hrickards at l33tmyst.com>
lives_widget_hide (prefsw->cdda_hbox);
}
break;
-@@ -3692,7 +3692,7 @@ _prefsw *create_prefs_dialog (void) {
+@@ -3728,7 +3728,7 @@ _prefsw *create_prefs_dialog (void) {
lives_container_add (LIVES_CONTAINER (dialog_table), prefsw->scrollw_right_misc);
diff --git a/debian/patches/03-libav9.patch b/debian/patches/03-libav9.patch
deleted file mode 100644
index 0e8347f..0000000
--- a/debian/patches/03-libav9.patch
+++ /dev/null
@@ -1,648 +0,0 @@
-Description: Fix compilation with libav 9
- This patch includes libav 9 related fixes up until revision
- 1943. It also contains a temporary workaround for avpriv_set_pts_info.
-Origin: upstream
-Last-Update: 2013-11-29
-
---- 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,42 @@
- #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 !defined(HAVE_AVPRIV_SET_PTS_INFO) && LIBAVFORMAT_VERSION_MAJOR >= 54
-+void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
-+ unsigned int pts_num, unsigned int pts_den);
-+#define HAVE_AVPRIV_SET_PTS_INFO 1
-+#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 +2035,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 +2356,9 @@
- cdata->asigned=TRUE;
- cdata->ainterleaf=TRUE;
-
-+ av_free(priv->picture);
-+ priv->picture=NULL;
-+
- return cdata;
- }
-
-@@ -2378,18 +2414,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 +2455,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 +2512,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 +2563,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 +2574,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 +2584,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 +2596,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,66 @@
-
- #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 !defined(HAVE_AVPRIV_SET_PTS_INFO) && LIBAVFORMAT_VERSION_MAJOR >= 54
-+void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
-+ unsigned int pts_num, unsigned int pts_den);
-+#define HAVE_AVPRIV_SET_PTS_INFO 1
-+#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 +146,6 @@
- };
-
-
--
- static enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
- {
- int i;
-@@ -1748,9 +1797,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 +2125,9 @@
- cdata->asigned=TRUE;
- cdata->ainterleaf=TRUE;
-
-+ av_free(priv->picture);
-+ priv->picture=NULL;
-+
- return cdata;
- }
-
-@@ -2604,6 +2656,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 +2693,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,69 @@
-
- #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
--#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 !defined(HAVE_AVPRIV_SET_PTS_INFO) && LIBAVFORMAT_VERSION_MAJOR >= 54
-+void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
-+ unsigned int pts_num, unsigned int pts_den);
-+#define HAVE_AVPRIV_SET_PTS_INFO 1
-+#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 +1052,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 +3108,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 +3336,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 +3564,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 +3602,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
-+FLVDEC_LIBS = @LIBAVCODEC_LIBS@ @LIBAVFORMAT_LIBS@ @LIBAVUTIL_LIBS@
-+FLVDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_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
-+ASFDEC_LIBS = @LIBAVCODEC_LIBS@ @LIBAVFORMAT_LIBS@ @LIBAVUTIL_LIBS@
-+ASFDEC_CFLAGS = @LIBAVFORMAT_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_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
diff --git a/debian/patches/series b/debian/patches/series
index 627617d..28e26b8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,2 @@
01-cdda2wav_to_icedax.patch
02-drop_py3_multiencoder.patch
-03-libav9.patch
--
lives packaging
More information about the pkg-multimedia-commits
mailing list