Package: dvbcut
Version: 0.5.4+svn178-11
Severity: important
Tags: patch
User: pkg-multimedia-maintain...@lists.alioth.debian.org
Usertags: ffmpeg2.9
Dear Maintainer,
your package fails to build with the upcoming ffmpeg 2.9.
This bug will become release-critical at some point when the
ffmpeg2.9 transition gets closer.
Attached is a patch replacing the deprecated functionality.
It also works with ffmpeg 2.8.
Please apply this patch and forward it upstream, if necessary.
These changes have little regression potential.
Best regards,
Andreas
diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 000..d2ee1ca
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,92 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun
+Last-Update: <2015-11-02>
+
+--- dvbcut-0.5.4+svn178.orig/src/avframe.cpp
dvbcut-0.5.4+svn178/src/avframe.cpp
+@@ -29,12 +29,12 @@ avframe::avframe() : tobefreed(0),w(0),h
+ avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt()
+ #endif
+ {
+- f=avcodec_alloc_frame();
++ f=av_frame_alloc();
+ }
+
+ avframe::avframe(AVFrame *src, AVCodecContext *ctx) : f(0),tobefreed(0)
+ {
+- f=avcodec_alloc_frame();
++ f=av_frame_alloc();
+ tobefreed=malloc(avpicture_get_size(ctx->pix_fmt, ctx->width, ctx->height));
+
+ avpicture_fill((AVPicture *)f,
+@@ -65,7 +65,7 @@ avframe::avframe(AVFrame *src, AVCodecCo
+ dw=w*ctx->sample_aspect_ratio.num/ctx->sample_aspect_ratio.den;
+ #ifdef HAVE_LIB_SWSCALE
+ img_convert_ctx=sws_getContext(w, h, pix_fmt,
+- w, h, PIX_FMT_BGR24, SWS_BICUBIC,
++ w, h, AV_PIX_FMT_BGR24, SWS_BICUBIC,
+ NULL, NULL, NULL);
+ #endif
+ }
+@@ -75,7 +75,7 @@ avframe::~avframe()
+ if (tobefreed)
+ free(tobefreed);
+ if (f)
+-av_free(f);
++av_frame_free(&f);
+ #ifdef HAVE_LIB_SWSCALE
+ if (img_convert_ctx)
+ sws_freeContext(img_convert_ctx);
+@@ -91,20 +91,20 @@ QImage avframe::getqimage(bool scaled, d
+ #endif
+ return QImage();
+
+- uint8_t *rgbbuffer=(uint8_t*)malloc(avpicture_get_size(PIX_FMT_RGB24, w, h)+64);
++ uint8_t *rgbbuffer=(uint8_t*)malloc(avpicture_get_size(AV_PIX_FMT_RGB24, w, h)+64);
+ int headerlen=sprintf((char *) rgbbuffer, "P6\n%d %d\n255\n", w, h);
+
+- AVFrame *avframergb=avcodec_alloc_frame();
++ AVFrame *avframergb=av_frame_alloc();
+
+ avpicture_fill((AVPicture*)avframergb,
+ rgbbuffer+headerlen,
+- PIX_FMT_RGB24,w,h);
++ AV_PIX_FMT_RGB24,w,h);
+
+ #ifdef HAVE_LIB_SWSCALE
+ sws_scale(img_convert_ctx, f->data, f->linesize, 0, h,
+ avframergb->data, avframergb->linesize);
+ #else
+- img_convert((AVPicture *)avframergb, PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
++ img_convert((AVPicture *)avframergb, AV_PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h);
+ #endif
+
+ QImage im;
+@@ -123,6 +123,6 @@ QImage avframe::getqimage(bool scaled, d
+ }
+
+ free(rgbbuffer);
+- av_free(avframergb);
++ av_frame_free(&avframergb);
+ return (im);
+ }
+--- dvbcut-0.5.4+svn178.orig/src/avframe.h
dvbcut-0.5.4+svn178/src/avframe.h
+@@ -40,7 +40,7 @@ protected:
+ AVFrame *f;
+ void *tobefreed;
+ int w,h,dw;
+- enum PixelFormat pix_fmt;
++ enum AVPixelFormat pix_fmt;
+ #ifdef HAVE_LIB_SWSCALE
+ struct SwsContext *img_convert_ctx;
+ #endif
+@@ -70,7 +70,7 @@ public:
+ {
+ return dw;
+ }
+- enum PixelFormat getpixfmt() const
++ enum AVPixelFormat getpixfmt() const
+ {
+ return pix_fmt;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index a4ab752..891c8de 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@ avoid-PATH_MAX-macro.patch
add-mousewheel-modifiers-to-help-page.patch
fix-index-creation-on-arm.patch
fix_ffmpeg_includes.patch
+ffmpeg_2.9.patch