Description: FTBFS with libav 0.9 (Debian experimental and Ubuntu raring)
Author: Fabrice Coutadeur <fabricesp@ubuntu.com>
Bug-Debian: http://bugs.debian.org/693543
Forwarded: no

Index: vxl-1.17.0/core/vidl/vidl_ffmpeg_ostream_v4.txx
===================================================================
--- vxl-1.17.0.orig/core/vidl/vidl_ffmpeg_ostream_v4.txx	2013-05-15 16:57:56.171429064 +0200
+++ vxl-1.17.0/core/vidl/vidl_ffmpeg_ostream_v4.txx	2013-05-15 16:58:36.183428612 +0200
@@ -25,11 +25,21 @@
 extern "C" {
 #if FFMPEG_IN_SEVERAL_DIRECTORIES
 #include <libavformat/avformat.h>
+#include <libavutil/mem.h>
 #else
 #include <ffmpeg/avformat.h>
 #endif
 }
 
+// Define deprecated codec flags as private
+#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
+#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
+#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
+#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
+#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
+#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
+#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
+
 //-----------------------------------------------------------------------------
 
 
@@ -117,7 +127,7 @@
   os_->fmt_cxt_->nb_streams = 0;
 
   // Create stream
-  AVStream* st = av_new_stream( os_->fmt_cxt_, 0 );
+  AVStream* st = avformat_new_stream( os_->fmt_cxt_, 0 );
   if ( !st ) {
     vcl_cerr << "ffmpeg: could not alloc stream\n";
     close();
@@ -229,7 +239,7 @@
   if (params_.video_qscale_ || params_.same_quality_)
   {
     video_enc->flags |= CODEC_FLAG_QSCALE;
-    st->quality = FF_QP2LAMBDA * params_.video_qscale_;
+    video_enc->global_quality = FF_QP2LAMBDA * params_.video_qscale_;
   }
   // if (bitexact)
   //   video_enc->flags |= CODEC_FLAG_BITEXACT;
@@ -377,7 +387,7 @@
 
   vcl_strncpy( os_->fmt_cxt_->filename, filename_.c_str(), 1023 );
 
-  if ( avio_open( &os_->fmt_cxt_->pb, filename_.c_str(), URL_WRONLY) < 0 )
+  if ( avio_open( &os_->fmt_cxt_->pb, filename_.c_str(), AVIO_FLAG_WRITE) < 0 )
   {
     vcl_cerr << "ffmpeg: couldn't open " << filename_ << " for writing\n";
     close();
@@ -387,7 +397,7 @@
 
   //dump_format( os_->fmt_cxt_, 1, filename_, 1 );
 
-  if ( avcodec_open( video_enc, codec ) < 0 )
+  if ( avcodec_open2( video_enc, codec, NULL ) < 0 )
   {
     vcl_cerr << "ffmpeg: couldn't open codec\n";
     close();
Index: vxl-1.17.0/core/vidl/vidl_ffmpeg_istream_v3.txx
===================================================================
--- vxl-1.17.0.orig/core/vidl/vidl_ffmpeg_istream_v3.txx	2013-05-15 16:57:56.195429062 +0200
+++ vxl-1.17.0/core/vidl/vidl_ffmpeg_istream_v3.txx	2013-05-15 16:58:36.183428612 +0200
@@ -143,7 +143,7 @@
   }
 
   // Get the stream information by reading a bit of the file
-  if ( av_find_stream_info( is_->fmt_cxt_ ) < 0 ) {
+  if ( avformat_find_stream_info( is_->fmt_cxt_, NULL ) < 0 ) {
     return false;
   }
 
@@ -165,7 +165,7 @@
 
   // Open the stream
   AVCodec* codec = avcodec_find_decoder(enc->codec_id);
-  if ( !codec || avcodec_open( enc, codec ) < 0 ) {
+  if ( !codec || avcodec_open2( enc, codec, NULL ) < 0 ) {
     return false;
   }
 
