[Debian-med-packaging] Bug#739211: Updated, simplified patch

Andreas Tille andreas at an3as.eu
Mon Feb 24 16:10:48 UTC 2014


Hi,

I uploaded the package to experimental since it seems to build only
there.  Do you have any migration plan in mind?  If the migration might
last some time I'd consider uploading the new upstream version without
the patch to unstable as well.

Thanks for the patch in any case

      Andreas.

On Mon, Feb 24, 2014 at 01:08:13PM +0000, Reinhard Tartler wrote:
> Package: amide
> Followup-For: Bug #739211
> 
> An internal review by the libav developer resulted in suggestions how to
> simplify the API usage of avcodec_encode_video2. Please consider this updated patch.
> 
> Best,
> Reinhard
> 
> 
> 
> -- System Information:
> Debian Release: 7.4
>   APT prefers stable
>   APT policy: (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 3.11.0-17-generic (SMP w/2 CPU cores)
> Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash

> Description: Fix compilation against libav 10
> Author: Reinhard Tartler <siretart at tauware.de>
> Bug-Debian: http://bugs.debian.org/739211
> 
> --- a/src/mpeg_encode.c
> +++ b/src/mpeg_encode.c
> @@ -142,6 +142,7 @@ static void convert_rgb_pixbuf_to_yuv(yu
>  #ifdef AMIDE_FFMPEG_SUPPORT
>  
>  #include <libavcodec/avcodec.h>
> +#include <libavutil/frame.h>
>  
>  
>  typedef struct {
> @@ -234,11 +235,11 @@ gpointer mpeg_encode_setup(gchar * outpu
>  
>    switch(type) {
>    case ENCODE_MPEG4:
> -    codec_type = CODEC_ID_MPEG4;
> +    codec_type = AV_CODEC_ID_MPEG4;
>      break;
>    case ENCODE_MPEG1:
>    default:
> -    codec_type=CODEC_ID_MPEG1VIDEO;
> +    codec_type=AV_CODEC_ID_MPEG1VIDEO;
>      break;
>    }
>  
> @@ -268,7 +269,7 @@ gpointer mpeg_encode_setup(gchar * outpu
>      return NULL;
>    }
>  
> -  encode->picture= avcodec_alloc_frame();
> +  encode->picture= av_frame_alloc();
>    if (!encode->picture) {
>      g_warning("couldn't allocate memory for encode->picture");
>      encode_free(encode);
> @@ -359,15 +360,19 @@ gpointer mpeg_encode_setup(gchar * outpu
>  
>  gboolean mpeg_encode_frame(gpointer data, GdkPixbuf * pixbuf) {
>    encode_t * encode = data;
> -  gint out_size;
> +  AVPacket pkt = { 0 };
> +  int ret, got_packet = 0;
>  
>    convert_rgb_pixbuf_to_yuv(encode->yuv, pixbuf);
>  
>    /* encode the image */
> -  out_size = avcodec_encode_video(encode->context, encode->output_buffer, encode->output_buffer_size, encode->picture);
> -  fwrite(encode->output_buffer, 1, out_size, encode->output_file);
> +  ret = avcodec_encode_video2(encode->context, &pkt, encode->picture, &got_packet);
>  
> -  return TRUE;
> +  if (ret >= 0 && got_packet) {
> +      fwrite(pkt.data, 1, pkt.size, encode->output_file);
> +      av_free_packet(&pkt);
> +  }
> +  return (ret >= 0) ? TRUE : FALSE;
>  };
>  
>  /* close everything up */

> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging


-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list