--- Begin Message ---
Package: fuse-emulator-utils
Version: 1.1.1-4
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..a986a18
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,126 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2015-11-02>
+
+--- fuse-emulator-utils-1.1.1.orig/fmfconv_ff.c
++++ fuse-emulator-utils-1.1.1/fmfconv_ff.c
+@@ -68,7 +68,7 @@
+ #include "fmfconv.h"
+
+ #define VRATE_MULT 2
+-static int sws_flags = SWS_BICUBIC | SWS_CPU_CAPS_3DNOW | SWS_CPU_CAPS_MMX2;
++static int sws_flags = SWS_BICUBIC;
+
+ int ffmpeg_arate = 0; /* audio bitrate */
+ int ffmpeg_vrate = 0; /* video bitrate */
+@@ -105,9 +105,9 @@ static int16_t **ffmpeg_sound;
+ static uint8_t *video_outbuf;
+ static int video_outbuf_size;
+
+-static AVFrame *alloc_picture( enum PixelFormat pix_fmt, int width, int height, void *fmf_pict );
++static AVFrame *alloc_picture( enum AVPixelFormat pix_fmt, int width, int height, void *fmf_pict );
+
+-static enum PixelFormat out_pix_fmt = PIX_FMT_NONE;
++static enum AVPixelFormat out_pix_fmt = AV_PIX_FMT_NONE;
+ /* FFMPEG utility functions */
+
+ static int res_rte = -1;
+@@ -201,7 +201,7 @@ ffmpeg_rescale_video( void )
+ if( !ff_tmp_picture ) {
+ printe( "FFMPEG: Could not allocate temporary picture\n" );
+ avcodec_close( video_st->codec );
+- av_free( ff_picture );
++ av_frame_free( &ff_picture );
+ return 1;
+ }
+ res_w = frm_w;
+@@ -209,14 +209,14 @@ ffmpeg_rescale_video( void )
+ }
+ if( video_resize_ctx == NULL ) {
+ video_resize_ctx = sws_getContext( res_w, res_h,
+- PIX_FMT_YUV444P,
++ AV_PIX_FMT_YUV444P,
+ out_w, out_h,
+ out_pix_fmt,
+ sws_flags, NULL, NULL, NULL );
+ if( !video_resize_ctx ) {
+ printe( "Cannot initialize the conversion context\n" );
+ avcodec_close( video_st->codec );
+- av_free( ff_picture );
++ av_frame_free( &ff_picture );
+ return 1;
+ }
+ ffmpeg_pict = ff_tmp_picture;
+@@ -224,7 +224,7 @@ ffmpeg_rescale_video( void )
+ sws_scale( video_resize_ctx,
+ (const uint8_t * const*)ff_picture->data, ff_picture->linesize,
+ 0, res_h, ff_tmp_picture->data, ff_tmp_picture->linesize );
+- printi( 3, "ffmpeg_rescale_frame(): resize %dx%d -> %dx%d pix format %d->%d\n", frm_w, frm_h, out_w, out_h, PIX_FMT_YUV444P, out_pix_fmt );
++ printi( 3, "ffmpeg_rescale_frame(): resize %dx%d -> %dx%d pix format %d->%d\n", frm_w, frm_h, out_w, out_h, AV_PIX_FMT_YUV444P, out_pix_fmt );
+ return 0;
+ }
+
+@@ -522,19 +522,19 @@ add_video_stream( enum AVCodecID codec_i
+ }
+
+ static AVFrame *
+-alloc_picture( enum PixelFormat pix_fmt, int width, int height, void *fmf_pict )
++alloc_picture( enum AVPixelFormat pix_fmt, int width, int height, void *fmf_pict )
+ {
+ AVFrame *picture;
+ uint8_t *picture_buf;
+ int size;
+
+- picture = avcodec_alloc_frame();
++ picture = av_frame_alloc();
+ if( !picture ) return NULL;
+ if( !fmf_pict ) {
+ size = avpicture_get_size( pix_fmt, width, height );
+ picture_buf = av_malloc( size );
+ if( !picture_buf ) {
+- av_free( picture );
++ av_frame_free( &picture );
+ return NULL;
+ }
+ avpicture_fill( (AVPicture *)picture, picture_buf,
+@@ -555,7 +555,7 @@ open_video( AVCodec *codec )
+ c = video_st->codec;
+
+ if( codec->pix_fmts == NULL )
+- c->pix_fmt = PIX_FMT_YUV420P;
++ c->pix_fmt = AV_PIX_FMT_YUV420P;
+ else
+ c->pix_fmt = codec->pix_fmts[0];
+
+@@ -606,7 +606,7 @@ open_video( AVCodec *codec )
+ }
+
+ /* allocate the encoded raw picture */
+- ff_picture = alloc_picture( PIX_FMT_YUV444P, frm_w, frm_h, pix_yuv[0] );
++ ff_picture = alloc_picture( AV_PIX_FMT_YUV444P, frm_w, frm_h, pix_yuv[0] );
+ ff_tmp_picture = NULL;
+
+ if( !ff_picture ) {
+@@ -673,11 +673,11 @@ close_video( void )
+ avcodec_close( video_st->codec );
+ if( ff_picture ) {
+ /* av_free( ff_picture->data[0] ); */
+- av_free( ff_picture );
++ av_frame_free( ff_picture );
+ }
+ if( ff_tmp_picture ) {
+ av_free( ff_tmp_picture->data[0] );
+- av_free( ff_tmp_picture );
++ av_frame_free( &ff_tmp_picture );
+ }
+ if( video_outbuf ) av_free( video_outbuf );
+ }
+@@ -872,7 +872,7 @@ out_write_ffmpeg( void )
+
+ if( !video_st ) return 0;
+
+- if( ( out_w != frm_w || out_h != frm_h || out_pix_fmt != PIX_FMT_YUV444P ) &&
++ if( ( out_w != frm_w || out_h != frm_h || out_pix_fmt != AV_PIX_FMT_YUV444P ) &&
+ ( err = ffmpeg_rescale_video() ) ) return err;
+ ffmpeg_add_frame_ffmpeg();
+ printi( 2, "out_write_ffmpeg(): add frame\n" );
diff --git a/debian/patches/series b/debian/patches/series
index f08164b..a314b65 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
libav10.patch
fix-wav-sample-rate.patch
+ffmpeg_2.9.patch
--- End Message ---