openbsd-ports/multimedia/transcode/patches/patch-import_decode_lavc_c
2013-01-26 12:47:44 +00:00

34 lines
1.2 KiB
Plaintext

$OpenBSD: patch-import_decode_lavc_c,v 1.4 2013/01/26 12:47:44 brad Exp $
Update for newer FFmpeg API.
--- import/decode_lavc.c.orig Sat Nov 19 11:50:27 2011
+++ import/decode_lavc.c Fri Jan 18 22:01:06 2013
@@ -120,6 +120,7 @@ void decode_lavc(decode_t *decode)
char *yuv2rgb_buffer = NULL;
AVCodec *lavc_dec_codec = NULL;
AVCodecContext *lavc_dec_context;
+ AVDictionary *opts = NULL;
int x_dim = 0, y_dim = 0;
int pix_fmt, frame_size = 0, bpp = 8;
struct ffmpeg_codec *codec;
@@ -177,16 +178,11 @@ void decode_lavc(decode_t *decode)
}
lavc_dec_context->width = x_dim;
lavc_dec_context->height = y_dim;
-
-#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- lavc_dec_context->error_resilience = 2;
-#else
- lavc_dec_context->error_recognition = 2;
-#endif
+ av_dict_set(&opts, "err_detect", "compliant", 0);
lavc_dec_context->error_concealment = 3;
lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
- if (avcodec_open(lavc_dec_context, lavc_dec_codec) < 0) {
+ if (avcodec_open2(lavc_dec_context, lavc_dec_codec, &opts) < 0) {
tc_log_error(__FILE__, "Could not initialize the '%s' codec.",
codec->name);
goto decoder_error;