Package: lightspark
Version: 0.7.2+git20150512-2
Severity: important
Tags: patch
User: [email protected]
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 0000000..e0b9d65
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,105 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2015-11-02>
+
+--- lightspark-0.7.2+git20150512.orig/src/backends/decoder.cpp
++++ lightspark-0.7.2+git20150512/src/backends/decoder.cpp
+@@ -166,7 +166,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(L
+ 	else
+ 		status=INIT;
+ 
+-	frameIn=avcodec_alloc_frame();
++	frameIn=av_frame_alloc();
+ }
+ 
+ FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint):
+@@ -201,7 +201,7 @@ FFMpegVideoDecoder::FFMpegVideoDecoder(A
+ 	if(fillDataAndCheckValidity())
+ 		status=VALID;
+ 
+-	frameIn=avcodec_alloc_frame();
++	frameIn=av_frame_alloc();
+ }
+ 
+ FFMpegVideoDecoder::~FFMpegVideoDecoder()
+@@ -210,7 +210,7 @@ FFMpegVideoDecoder::~FFMpegVideoDecoder(
+ 	avcodec_close(codecContext);
+ 	if(ownedContext)
+ 		av_free(codecContext);
+-	av_free(frameIn);
++	av_frame_free(&frameIn);
+ }
+ 
+ //setSize is called from the routine that inserts new frames
+@@ -274,7 +274,7 @@ bool FFMpegVideoDecoder::decodeData(uint
+ 	assert_and_throw(ret==(int)datalen);
+ 	if(frameOk)
+ 	{
+-		assert(codecContext->pix_fmt==PIX_FMT_YUV420P);
++		assert(codecContext->pix_fmt==AV_PIX_FMT_YUV420P);
+ 
+ 		if(status==INIT && fillDataAndCheckValidity())
+ 			status=VALID;
+@@ -301,7 +301,7 @@ bool FFMpegVideoDecoder::decodePacket(AV
+ 	assert_and_throw(ret==(int)pkt->size);
+ 	if(frameOk)
+ 	{
+-		assert(codecContext->pix_fmt==PIX_FMT_YUV420P);
++		assert(codecContext->pix_fmt==AV_PIX_FMT_YUV420P);
+ 
+ 		if(status==INIT && fillDataAndCheckValidity())
+ 			status=VALID;
+@@ -476,7 +476,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(L
+ 	else
+ 		status=INIT;
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	frameIn=avcodec_alloc_frame();
++	frameIn=av_frame_alloc();
+ #endif
+ }
+ 
+@@ -502,7 +502,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(L
+ 	if(fillDataAndCheckValidity())
+ 		status=VALID;
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	frameIn=avcodec_alloc_frame();
++	frameIn=av_frame_alloc();
+ #endif
+ }
+ 
+@@ -522,7 +522,7 @@ FFMpegAudioDecoder::FFMpegAudioDecoder(A
+ 	if(fillDataAndCheckValidity())
+ 		status=VALID;
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	frameIn=avcodec_alloc_frame();
++	frameIn=av_frame_alloc();
+ #endif
+ }
+ 
+@@ -532,7 +532,7 @@ FFMpegAudioDecoder::~FFMpegAudioDecoder(
+ 	if(ownedContext)
+ 		av_free(codecContext);
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	av_free(frameIn);
++	av_frame_free(&frameIn);
+ #endif
+ }
+ 
+@@ -607,7 +607,7 @@ uint32_t FFMpegAudioDecoder::decodeData(
+ 	}
+ 
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	avcodec_get_frame_defaults(frameIn);
++	av_frame_unref(frameIn);
+ 	int frameOk=0;
+ 	int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt);
+ 	if(frameOk==0)
+@@ -664,7 +664,7 @@ uint32_t FFMpegAudioDecoder::decodePacke
+ 	int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ 
+ #if HAVE_AVCODEC_DECODE_AUDIO4
+-	avcodec_get_frame_defaults(frameIn);
++	av_frame_unref(frameIn);
+ 	int frameOk=0;
+ 	int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt);
+ 	if(frameOk==0)
diff --git a/debian/patches/series b/debian/patches/series
index 900d479..d4d29d1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 #fix-for-llvm35.patch
 #libav10.patch
 assert.patch
+ffmpeg_2.9.patch

Reply via email to