Bug#739458: FTBFS with libav10

2014-02-23 Thread anton

Hi,
the attached patch should fix this bug.

-- 
Anton KhirnovIndex: xine-lib-1.2-1.2.4/src/video_out/video_out_vaapi.c
===
--- xine-lib-1.2-1.2.4.orig/src/video_out/video_out_vaapi.c	2014-02-23 13:57:29.0 +
+++ xine-lib-1.2-1.2.4/src/video_out/video_out_vaapi.c	2014-02-23 14:05:16.643014434 +
@@ -1151,14 +1151,14 @@
   enum CodecID codec_id;
 #endif
 } conversion_map[] = {
-  {IMGFMT_VAAPI_MPEG2, PIX_FMT_VAAPI_VLD,  CODEC_ID_MPEG2VIDEO},
-  {IMGFMT_VAAPI_MPEG2_IDCT,PIX_FMT_VAAPI_IDCT, CODEC_ID_MPEG2VIDEO},
-  {IMGFMT_VAAPI_MPEG2_MOCO,PIX_FMT_VAAPI_MOCO, CODEC_ID_MPEG2VIDEO},
-  {IMGFMT_VAAPI_MPEG4, PIX_FMT_VAAPI_VLD,  CODEC_ID_MPEG4},
-  {IMGFMT_VAAPI_H263,  PIX_FMT_VAAPI_VLD,  CODEC_ID_H263},
-  {IMGFMT_VAAPI_H264,  PIX_FMT_VAAPI_VLD,  CODEC_ID_H264},
-  {IMGFMT_VAAPI_WMV3,  PIX_FMT_VAAPI_VLD,  CODEC_ID_WMV3},
-  {IMGFMT_VAAPI_VC1,   PIX_FMT_VAAPI_VLD,  CODEC_ID_VC1},
+  {IMGFMT_VAAPI_MPEG2, PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_MPEG2VIDEO},
+  {IMGFMT_VAAPI_MPEG2_IDCT,PIX_FMT_VAAPI_IDCT, AV_CODEC_ID_MPEG2VIDEO},
+  {IMGFMT_VAAPI_MPEG2_MOCO,PIX_FMT_VAAPI_MOCO, AV_CODEC_ID_MPEG2VIDEO},
+  {IMGFMT_VAAPI_MPEG4, PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_MPEG4},
+  {IMGFMT_VAAPI_H263,  PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_H263},
+  {IMGFMT_VAAPI_H264,  PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_H264},
+  {IMGFMT_VAAPI_WMV3,  PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_WMV3},
+  {IMGFMT_VAAPI_VC1,   PIX_FMT_VAAPI_VLD,  AV_CODEC_ID_VC1},
   {0, PIX_FMT_NONE}
 };
 
Index: xine-lib-1.2-1.2.4/src/dxr3/ffmpeg_encoder.c
===
--- xine-lib-1.2-1.2.4.orig/src/dxr3/ffmpeg_encoder.c	2013-09-18 10:04:54.0 +
+++ xine-lib-1.2-1.2.4/src/dxr3/ffmpeg_encoder.c	2014-02-23 14:11:57.853916862 +
@@ -49,11 +49,6 @@
 
 #include ../combined/ffmpeg/ffmpeg_compat.h
 
-/* buffer size for encoded mpeg1 stream; will hold one intra frame
- * at 640x480 typical sizes are 50 kB. 512 kB should be plenty */
-#define DEFAULT_BUFFER_SIZE 512*1024
-
-
 /* functions required by encoder api */
 static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame);
 static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame);
@@ -64,7 +59,6 @@
   encoder_data_t encoder_data;
   AVCodecContext *context; /* handle for encoding */
   intwidth, height;/* width and height of the video frame */
-  uint8_t*ffmpeg_buffer;   /* lavc buffer */
   AVFrame*picture; /* picture to be encoded */
   uint8_t*out[3];  /* aligned buffer for YV12 data */
   uint8_t*buf; /* base address of YV12 buffer */
@@ -142,7 +136,7 @@
   }
 
   /* get mpeg codec handle */
-  codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
+  codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
   if (!codec) {
 xprintf(drv-class-xine, XINE_VERBOSITY_LOG,
   dxr3_mpeg_encoder: lavc MPEG1 codec not found\n);
@@ -225,20 +219,13 @@
   }
   lprintf(dxr3_mpeg_encoder: lavc MPEG1 codec opened.\n);
 
-  if (!this-ffmpeg_buffer)
-this-ffmpeg_buffer = (unsigned char *)malloc(DEFAULT_BUFFER_SIZE); /* why allocate more than needed ?! */
-  if (!this-ffmpeg_buffer) {
-xprintf(drv-class-xine, XINE_VERBOSITY_LOG,
-  dxr3_mpeg_encoder: Couldn't allocate temp buffer for mpeg data\n);
-return 0;
-  }
-
   return 1;
 }
 
 static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame)
 {
-  int size;
+  AVPacket pkt = { 0 };
+  int ret, got_output;
   lavc_data_t* this = (lavc_data_t *)drv-enc;
   ssize_t written;
 
@@ -254,25 +241,28 @@
   lavc_prepare_frame(this, drv, frame);
 
   /* do the encoding */
-  size = avcodec_encode_video(this-context, this-ffmpeg_buffer, DEFAULT_BUFFER_SIZE, this-picture);
+  ret = avcodec_encode_video2(this-context, pkt, this-picture, got_output);
 
   frame-vo_frame.free(frame-vo_frame);
 
-  if (size  0) {
+  if (ret  0) {
   xprintf(drv-class-xine, XINE_VERBOSITY_LOG,
 dxr3_mpeg_encoder: encoding failed\n);
   return 0;
-  }
+  } else if (!got_output)
+  return 1;
 
-  written = write(drv-fd_video, this-ffmpeg_buffer, size);
+  written = write(drv-fd_video, pkt.data, pkt.size);
   if (written  0) {
+  av_packet_unref(pkt);
   xprintf(drv-class-xine, XINE_VERBOSITY_LOG,
 dxr3_mpeg_encoder: video device write failed (%s)\n, strerror(errno));
   return 0;
 }
-  if (written != size)
+  if (written != pkt.size)
   xprintf(drv-class-xine, XINE_VERBOSITY_LOG,
-dxr3_mpeg_encoder: Could only write %zd of %d mpeg bytes.\n, written, size);
+dxr3_mpeg_encoder: Could only write %zd of %d mpeg bytes.\n, written, pkt.size);
+  av_packet_unref(pkt);
   return 1;
 }
 
Index: xine-lib-1.2-1.2.4/src/combined/ffmpeg/ff_video_decoder.c
===
--- 

Bug#739458: FTBFS with libav10

2014-02-18 Thread Moritz Muehlenhoff
Source: xine-lib-1.2
Severity: important

Hi,
your package fails to build from source against libav 10 (currently
packaged in experimental). This bug will become release-critical
at some point when the libav10 transition starts.

Migration documentation can be found at
https://wiki.libav.org/Migration/10

Cheers,
Moritz


  CC   xineplug_vo_out_vaapi_la-video_out_vaapi.lo
video_out_vaapi.c:1154:48: error: 'CODEC_ID_MPEG2VIDEO' undeclared
here (not in a function)
   {IMGFMT_VAAPI_MPEG2, PIX_FMT_VAAPI_VLD,  CODEC_ID_MPEG2VIDEO},
^
video_out_vaapi.c:1157:48: error: 'CODEC_ID_MPEG4' undeclared here
(not in a function)
   {IMGFMT_VAAPI_MPEG4, PIX_FMT_VAAPI_VLD,  CODEC_ID_MPEG4},
^
video_out_vaapi.c:1158:48: error: 'CODEC_ID_H263' undeclared here (not
in a function)
   {IMGFMT_VAAPI_H263,  PIX_FMT_VAAPI_VLD,  CODEC_ID_H263},
^
video_out_vaapi.c:1159:48: error: 'CODEC_ID_H264' undeclared here (not
in a function)
   {IMGFMT_VAAPI_H264,  PIX_FMT_VAAPI_VLD,  CODEC_ID_H264},
^
video_out_vaapi.c:1160:48: error: 'CODEC_ID_WMV3' undeclared here (not
in a function)
   {IMGFMT_VAAPI_WMV3,  PIX_FMT_VAAPI_VLD,  CODEC_ID_WMV3},
^
video_out_vaapi.c:1161:48: error: 'CODEC_ID_VC1' undeclared here (not
in a function)
   {IMGFMT_VAAPI_VC1,   PIX_FMT_VAAPI_VLD,  CODEC_ID_VC1},
^
video_out_vaapi.c: In function 'yuy2_to_nv12':
video_out_vaapi.c:3078:41: warning: assignment makes integer from
pointer without a cast [enabled by default]
   *(uv_dst_tmp + (height*width/4) ) = (yuy2_map +
   (height*width/2));
 ^
video_out_vaapi.c:3079:45: warning: assignment makes integer from
pointer without a cast [enabled by default]
   *(uv_dst_tmp + (height*width/4) + 2 ) = (yuy2_map +
   (height*width/2) + 2);
 ^
video_out_vaapi.c:3058:7: warning: unused variable 'uv_dst_size'
[-Wunused-variable]
   int uv_dst_size = dst_height * uv_dst_pitch / 2;
   ^
make[4]: *** [xineplug_vo_out_vaapi_la-video_out_vaapi.lo] Error 1
make[4]: Leaving directory
`/home/jmm/av10/xine-lib-1.2-1.2.4/src/video_out'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/jmm/av10/xine-lib-1.2-1.2.4/src/video_out'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/jmm/av10/xine-lib-1.2-1.2.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jmm/av10/xine-lib-1.2-1.2.4'
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
j


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org