1 Submitted By: Armion K. <krejzi at email dot com>
2 Date: 2016-05-06
3 Initial Package Version: 1.1.7
4 Upstream Status: Unknown
5 Origin: Gentoo and Debian
6 Description: Fixes building against FFmpeg version >= 3.0.0
7
8 --- a/encode/encode_lavc.c 2011-11-19 17:50:27.000000000 +0100
9 +++ b/encode/encode_lavc.c 2016-02-15 16:08:37.914488116 +0100
10 @@ -74,6 +74,9 @@
11 int lmin;
12 int lmax;
13 int me_method;
14 + int luma_elim_threshold;
15 + int chroma_elim_threshold;
16 + int quantizer_noise_shaping;
17
18 /* same as above for flags */
19 struct {
20 @@ -114,6 +117,7 @@
21
22 AVFrame ff_venc_frame;
23 AVCodecContext ff_vcontext;
24 + AVDictionary * ff_opts;
25
26 AVCodec *ff_vcodec;
27
28 @@ -164,6 +168,7 @@
29 TC_CODEC_ERROR
30 };
31
32 +#if LIBAVCODEC_VERSION_MAJOR < 55
33 static const enum CodecID tc_lavc_internal_codecs[] = {
34 CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4,
35 CODEC_ID_H263I, CODEC_ID_H263P,
36 @@ -176,6 +181,20 @@
37 CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3,
38 CODEC_ID_NONE
39 };
40 +#else
41 +static const enum AVCodecID tc_lavc_internal_codecs[] = {
42 + AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4,
43 + AV_CODEC_ID_H263I, AV_CODEC_ID_H263P,
44 + AV_CODEC_ID_H264,
45 + AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2,
46 + AV_CODEC_ID_RV10,
47 + AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_FFV1,
48 + AV_CODEC_ID_DVVIDEO,
49 + AV_CODEC_ID_MJPEG, AV_CODEC_ID_LJPEG,
50 + AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3,
51 + AV_CODEC_ID_NONE
52 +};
53 +#endif
54
55 static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR };
56
57 @@ -214,7 +233,7 @@
58 vframe_list_t *vframe)
59 {
60 avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf,
61 - PIX_FMT_YUV420P,
62 + AV_PIX_FMT_YUV420P,
63 pd->ff_vcontext.width, pd->ff_vcontext.height);
64 }
65
66 @@ -228,7 +247,7 @@
67 IMG_YUV_DEFAULT,
68 pd->ff_vcontext.width, pd->ff_vcontext.height);
69 avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
70 - PIX_FMT_YUV422P,
71 + AV_PIX_FMT_YUV422P,
72 pd->ff_vcontext.width, pd->ff_vcontext.height);
73 ac_imgconvert(src, IMG_YUV_DEFAULT,
74 pd->ff_venc_frame.data, IMG_YUV422P,
75 @@ -244,7 +263,7 @@
76 IMG_YUV422P,
77 pd->ff_vcontext.width, pd->ff_vcontext.height);
78 avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
79 - PIX_FMT_YUV420P,
80 + AV_PIX_FMT_YUV420P,
81 pd->ff_vcontext.width, pd->ff_vcontext.height);
82 ac_imgconvert(src, IMG_YUV422P,
83 pd->ff_venc_frame.data, IMG_YUV420P,
84 @@ -256,7 +275,7 @@
85 vframe_list_t *vframe)
86 {
87 avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf,
88 - PIX_FMT_YUV422P,
89 + AV_PIX_FMT_YUV422P,
90 pd->ff_vcontext.width, pd->ff_vcontext.height);
91
92 }
93 @@ -266,7 +285,7 @@
94 vframe_list_t *vframe)
95 {
96 avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
97 - PIX_FMT_YUV420P,
98 + AV_PIX_FMT_YUV420P,
99 pd->ff_vcontext.width, pd->ff_vcontext.height);
100 ac_imgconvert(&vframe->video_buf, IMG_RGB_DEFAULT,
101 pd->ff_venc_frame.data, IMG_YUV420P,
102 @@ -591,21 +610,21 @@
103 case CODEC_YUV:
104 if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) {
105 pd->tc_pix_fmt = TC_CODEC_YUV422P;
106 - pd->ff_vcontext.pix_fmt = PIX_FMT_YUV422P;
107 + pd->ff_vcontext.pix_fmt = AV_PIX_FMT_YUV422P;
108 pd->pre_encode_video = pre_encode_video_yuv420p_huffyuv;
109 } else {
110 pd->tc_pix_fmt = TC_CODEC_YUV420P;
111 pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG)
112 - ? PIX_FMT_YUVJ420P
113 - : PIX_FMT_YUV420P;
114 + ? AV_PIX_FMT_YUVJ420P
115 + : AV_PIX_FMT_YUV420P;
116 pd->pre_encode_video = pre_encode_video_yuv420p;
117 }
118 break;
119 case CODEC_YUV422:
120 pd->tc_pix_fmt = TC_CODEC_YUV422P;
121 pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG)
122 - ? PIX_FMT_YUVJ422P
123 - : PIX_FMT_YUV422P;
124 + ? AV_PIX_FMT_YUVJ422P
125 + : AV_PIX_FMT_YUV422P;
126 if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) {
127 pd->pre_encode_video = pre_encode_video_yuv422p_huffyuv;
128 } else {
129 @@ -615,10 +634,10 @@
130 case CODEC_RGB:
131 pd->tc_pix_fmt = TC_CODEC_RGB;
132 pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV)
133 - ? PIX_FMT_YUV422P
134 + ? AV_PIX_FMT_YUV422P
135 : (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG)
136 - ? PIX_FMT_YUVJ420P
137 - : PIX_FMT_YUV420P;
138 + ? AV_PIX_FMT_YUVJ420P
139 + : AV_PIX_FMT_YUV420P;
140 pd->pre_encode_video = pre_encode_video_rgb24;
141 break;
142 default:
143 @@ -937,7 +956,11 @@
144 static void tc_lavc_config_defaults(TCLavcPrivateData *pd)
145 {
146 /* first of all reinitialize lavc data */
147 +#if LIBAVCODEC_VERSION_MAJOR < 55
148 avcodec_get_context_defaults(&pd->ff_vcontext);
149 +#else
150 + avcodec_get_context_defaults3(&pd->ff_vcontext, NULL);
151 +#endif
152
153 pd->confdata.thread_count = 1;
154
155 @@ -955,8 +978,6 @@
156 /*
157 * context *transcode* (not libavcodec) defaults
158 */
159 - pd->ff_vcontext.mb_qmin = 2;
160 - pd->ff_vcontext.mb_qmax = 31;
161 pd->ff_vcontext.max_qdiff = 3;
162 pd->ff_vcontext.max_b_frames = 0;
163 pd->ff_vcontext.me_range = 0;
164 @@ -977,8 +998,8 @@
165 pd->ff_vcontext.mpeg_quant = 0;
166 pd->ff_vcontext.rc_initial_cplx = 0.0;
167 pd->ff_vcontext.rc_qsquish = 1.0;
168 - pd->ff_vcontext.luma_elim_threshold = 0;
169 - pd->ff_vcontext.chroma_elim_threshold = 0;
170 + pd->confdata.luma_elim_threshold = 0;
171 + pd->confdata.chroma_elim_threshold = 0;
172 pd->ff_vcontext.strict_std_compliance = 0;
173 pd->ff_vcontext.dct_algo = FF_DCT_AUTO;
174 pd->ff_vcontext.idct_algo = FF_IDCT_AUTO;
175 @@ -1002,7 +1023,7 @@
176 pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS;
177 pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS;
178 pd->ff_vcontext.noise_reduction = 0;
179 - pd->ff_vcontext.quantizer_noise_shaping = 0;
180 + pd->confdata.quantizer_noise_shaping = 0;
181 pd->ff_vcontext.flags = 0;
182 }
183
184 @@ -1033,17 +1054,10 @@
185 pd->ff_vcontext.me_method = ME_ZERO + pd->confdata.me_method;
186
187 pd->ff_vcontext.flags = 0;
188 - SET_FLAG(pd, mv0);
189 - SET_FLAG(pd, cbp);
190 SET_FLAG(pd, qpel);
191 - SET_FLAG(pd, alt);
192 - SET_FLAG(pd, vdpart);
193 - SET_FLAG(pd, naq);
194 SET_FLAG(pd, ilme);
195 SET_FLAG(pd, ildct);
196 SET_FLAG(pd, aic);
197 - SET_FLAG(pd, aiv);
198 - SET_FLAG(pd, umv);
199 SET_FLAG(pd, psnr);
200 SET_FLAG(pd, trell);
201 SET_FLAG(pd, gray);
202 @@ -1064,6 +1078,36 @@
203 pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT;
204 pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
205 }
206 + if (pd->confdata.flags.alt) {
207 + av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0);
208 + }
209 + if (pd->confdata.flags.vdpart) {
210 + av_dict_set(&(pd->ff_opts), "data_partitioning", "1", 0);
211 + }
212 + if (pd->confdata.flags.umv) {
213 + av_dict_set(&(pd->ff_opts), "umv", "1", 0);
214 + }
215 + if (pd->confdata.flags.aiv) {
216 + av_dict_set(&(pd->ff_opts), "aiv", "1", 0);
217 + }
218 + if (pd->confdata.flags.cbp) {
219 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0);
220 + }
221 + if (pd->confdata.flags.mv0) {
222 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+mv0", 0);
223 + }
224 + if (pd->confdata.flags.naq) {
225 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+naq", 0);
226 + }
227 +
228 + char buf[1024];
229 +#define set_dict_opt(val, opt) \
230 + snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\
231 + av_dict_set(&(pd->ff_opts), opt, buf, 0)
232 +
233 + set_dict_opt(luma_elim_threshold, "luma_elim_threshold");
234 + set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold");
235 + set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping");
236 }
237
238 #undef SET_FLAG
239 @@ -1116,12 +1160,10 @@
240 // handled by transcode core
241 // { "vqmax", PCTX(qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
242 // handled by transcode core
243 - { "mbqmin", PCTX(mb_qmin), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
244 - { "mbqmax", PCTX(mb_qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
245 { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
246 { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
247 { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
248 - { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES },
249 + { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX },
250 { "vme", PAUX(me_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16, },
251 { "me_range", PCTX(me_range), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000 },
252 { "mbd", PCTX(mb_decision), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
253 @@ -1150,8 +1192,8 @@
254 { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
255 // { "vrc_init_occupancy", }, // not yet supported
256 { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
257 - { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
258 - { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
259 + { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
260 + { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
261 { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
262 { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 },
263 { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
264 @@ -1177,25 +1219,25 @@
265 { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
266 { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
267 { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
268 - { "qns", PCTX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
269 + { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
270 { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
271 { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
272
273 - { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
274 - { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD },
275 + { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, 1 },
276 + { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 },
277 { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
278 - { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN },
279 + { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
280 { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
281 { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT },
282 - { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP },
283 - { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART },
284 + { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, 1 },
285 + { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 },
286 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
287 { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC },
288 #else
289 { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED },
290 #endif
291 - { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIV },
292 - { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV },
293 + { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 },
294 + { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 },
295 { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR },
296 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
297 { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT },
298 @@ -1345,12 +1387,14 @@
299
300 pd = self->userdata;
301
302 + pd->ff_opts = NULL;
303 +
304 pd->flush_flag = vob->encoder_flush;
305
306 /* FIXME: move into core? */
307 TC_INIT_LIBAVCODEC;
308
309 - avcodec_get_frame_defaults(&pd->ff_venc_frame);
310 + av_frame_unref(&pd->ff_venc_frame);
311 /*
312 * auxiliary config data needs to be blanked too
313 * before any other operation
314 @@ -1387,7 +1431,7 @@
315 pd->confdata.thread_count,
316 (pd->confdata.thread_count > 1) ?"s" :"");
317 }
318 - avcodec_thread_init(&pd->ff_vcontext, pd->confdata.thread_count);
319 + pd->ff_vcontext.thread_count = pd->confdata.thread_count;
320
321 pd->ff_vcodec = avcodec_find_encoder(FF_VCODEC_ID(pd));
322 if (pd->ff_vcodec == NULL) {
323 @@ -1397,11 +1441,11 @@
324 }
325
326 TC_LOCK_LIBAVCODEC;
327 - ret = avcodec_open(&pd->ff_vcontext, pd->ff_vcodec);
328 + ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, &(pd->ff_opts));
329 TC_UNLOCK_LIBAVCODEC;
330
331 if (ret < 0) {
332 - tc_log_error(MOD_NAME, "avcodec_open() failed");
333 + tc_log_error(MOD_NAME, "avcodec_open2() failed");
334 goto failed;
335 }
336 /* finally, pass up the extradata, if any */
337 @@ -1483,6 +1527,8 @@
338 vframe_list_t *outframe)
339 {
340 TCLavcPrivateData *pd = NULL;
341 + AVPacket pkt;
342 + int ret, got_packet = 0;
343
344 TC_MODULE_SELF_CHECK(self, "encode_video");
345
346 @@ -1497,12 +1543,15 @@
347
348 pd->pre_encode_video(pd, inframe);
349
350 + av_init_packet(&pkt);
351 + pkt.data = outframe->video_buf;
352 + pkt.size = inframe->video_size;
353 +
354 TC_LOCK_LIBAVCODEC;
355 - outframe->video_len = avcodec_encode_video(&pd->ff_vcontext,
356 - outframe->video_buf,
357 - inframe->video_size,
358 - &pd->ff_venc_frame);
359 + ret = avcodec_encode_video2(&pd->ff_vcontext, &pkt,
360 + &pd->ff_venc_frame, &got_packet);
361 TC_UNLOCK_LIBAVCODEC;
362 + outframe->video_len = ret ? ret : pkt.size;
363
364 if (outframe->video_len < 0) {
365 tc_log_warn(MOD_NAME, "encoder error: size (%i)",
366 --- a/export/aud_aux.c 2011-11-19 17:50:27.000000000 +0100
367 +++ b/export/aud_aux.c 2016-02-15 16:08:37.914488116 +0100
368 @@ -326,10 +326,10 @@
369
370 switch (o_codec) {
371 case 0x50:
372 - codeid = CODEC_ID_MP2;
373 + codeid = AV_CODEC_ID_MP2;
374 break;
375 case 0x2000:
376 - codeid = CODEC_ID_AC3;
377 + codeid = AV_CODEC_ID_AC3;
378 break;
379 default:
380 tc_warn("cannot init ffmpeg with %x", o_codec);
381 @@ -346,7 +346,7 @@
382
383 //-- set parameters (bitrate, channels and sample-rate) --
384 //--------------------------------------------------------
385 - avcodec_get_context_defaults(&mpa_ctx);
386 + avcodec_get_context_defaults3(&mpa_ctx, mpa_codec);
387 #if LIBAVCODEC_VERSION_MAJOR < 53
388 mpa_ctx.codec_type = CODEC_TYPE_AUDIO;
389 #else
390 @@ -359,11 +359,11 @@
391 //-- open codec --
392 //----------------
393 TC_LOCK_LIBAVCODEC;
394 - ret = avcodec_open(&mpa_ctx, mpa_codec);
395 + ret = avcodec_open2(&mpa_ctx, mpa_codec, NULL);
396 TC_UNLOCK_LIBAVCODEC;
397 if (ret < 0) {
398 tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
399 - (codeid == CODEC_ID_MP2) ?"mpa" :"ac3");
400 + (codeid == AV_CODEC_ID_MP2) ?"mpa" :"ac3");
401 return(TC_EXPORT_ERROR);
402 }
403
404 @@ -846,6 +846,9 @@
405 #ifdef HAVE_FFMPEG
406 int in_size, out_size;
407 char *in_buf;
408 + int got_packet;
409 + AVPacket avpkt = { 0 };
410 + AVFrame *frame = av_frame_alloc();
411
412 //-- input buffer and amount of bytes --
413 in_size = aud_size;
414 @@ -866,10 +869,14 @@
415
416 ac_memcpy(&mpa_buf[mpa_buf_ptr], in_buf, bytes_needed);
417
418 + frame->nb_samples = mpa_ctx.frame_size;
419 + avcodec_fill_audio_frame(frame, mpa_ctx.channels, mpa_ctx.sample_fmt, (const uint8_t *)mpa_buf, mpa_bytes_pf, 1);
420 + avpkt.data = output;
421 + avpkt.size = OUTPUT_SIZE;
422 TC_LOCK_LIBAVCODEC;
423 - out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
424 - OUTPUT_SIZE, (short *)mpa_buf);
425 + out_size = avcodec_encode_audio2(&mpa_ctx, &avpkt, frame, &got_packet);
426 TC_UNLOCK_LIBAVCODEC;
427 + out_size = avpkt.size;
428 tc_audio_write(output, out_size, avifile);
429
430 in_size -= bytes_needed;
431 @@ -884,6 +891,7 @@
432
433 ac_memcpy(&mpa_buf[mpa_buf_ptr], aud_buffer, bytes_avail);
434 mpa_buf_ptr += bytes_avail;
435 + av_frame_free(&frame);
436 return (0);
437 }
438 } //bytes availabe from last call?
439 @@ -893,10 +901,15 @@
440 //----------------------------------------------------
441
442 while (in_size >= mpa_bytes_pf) {
443 + av_frame_unref(frame);
444 + frame->nb_samples = mpa_ctx.frame_size;
445 + avcodec_fill_audio_frame(frame, mpa_ctx.channels, mpa_ctx.sample_fmt, (const uint8_t *)in_buf, mpa_bytes_pf, 1);
446 + avpkt.data = output;
447 + avpkt.size = OUTPUT_SIZE;
448 TC_LOCK_LIBAVCODEC;
449 - out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
450 - OUTPUT_SIZE, (short *)in_buf);
451 + out_size = avcodec_encode_audio2(&mpa_ctx, &avpkt, frame, &got_packet);
452 TC_UNLOCK_LIBAVCODEC;
453 + out_size = avpkt.size;
454
455 tc_audio_write(output, out_size, avifile);
456
457 @@ -904,6 +917,8 @@
458 in_buf += mpa_bytes_pf;
459 }
460
461 + av_frame_free(&frame);
462 +
463 //-- hold rest of bytes in mpa-buffer --
464 //--------------------------------------
465 if (in_size > 0) {
466 --- a/export/export_ffmpeg.c 2011-11-19 17:50:27.000000000 +0100
467 +++ b/export/export_ffmpeg.c 2016-02-15 16:08:37.915488139 +0100
468 @@ -122,6 +122,7 @@
469 static AVFrame *lavc_convert_frame = NULL;
470
471 static AVCodec *lavc_venc_codec = NULL;
472 +static AVDictionary *lavc_venc_opts = NULL;
473 static AVFrame *lavc_venc_frame = NULL;
474 static AVCodecContext *lavc_venc_context;
475 static avi_t *avifile = NULL;
476 @@ -180,7 +181,7 @@
477
478
479 /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */
480 -#include <libavcodec/opt.h>
481 +#include <libavutil/opt.h>
482 #include <libavutil/avstring.h>
483 #include <libswscale/swscale.h>
484
485 @@ -249,9 +250,9 @@
486 for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
487 /* GLUE: +if */
488 if (type == AVMEDIA_TYPE_VIDEO) {
489 - const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
490 - if(o2)
491 - ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
492 + o = av_opt_find(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
493 + if(o)
494 + ret = av_opt_set(avcodec_opts[type], opt, arg, 0);
495 /* GLUE: +if */
496 }
497 }
498 @@ -266,7 +267,10 @@
499 if(opt[0] == 'a')
500 ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
501 else */ if(opt[0] == 'v')
502 - ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
503 + {
504 + o = av_opt_find(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, NULL, 0, 0);
505 + ret = av_opt_set(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 0);
506 + }
507 /* GLUE: disabling
508 else if(opt[0] == 's')
509 ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
510 @@ -470,7 +474,6 @@
511 }
512
513 TC_LOCK_LIBAVCODEC;
514 - avcodec_init();
515 avcodec_register_all();
516 TC_UNLOCK_LIBAVCODEC;
517
518 @@ -486,11 +489,11 @@
519 codec->name, codec->fourCC, codec->comments);
520 }
521
522 - lavc_venc_context = avcodec_alloc_context();
523 - lavc_venc_frame = avcodec_alloc_frame();
524 + lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec);
525 + lavc_venc_frame = av_frame_alloc();
526
527 - lavc_convert_frame= avcodec_alloc_frame();
528 - size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
529 + lavc_convert_frame= av_frame_alloc();
530 + size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
531 enc_buffer = tc_malloc(size);
532
533 if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) {
534 @@ -634,7 +637,7 @@
535 lavc_param_rc_max_rate = 2516;
536 lavc_param_rc_buffer_size = 224 * 8;
537 lavc_param_rc_buffer_aggressivity = 99;
538 - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
539 + lavc_param_scan_offset = 1;
540
541 break;
542
543 @@ -674,7 +677,7 @@
544
545 lavc_param_rc_buffer_size = 224 * 8;
546 lavc_param_rc_buffer_aggressivity = 99;
547 - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
548 + lavc_param_scan_offset = 1;
549
550 break;
551
552 @@ -838,8 +841,13 @@
553 lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
554 lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
555 lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
556 - lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold;
557 - lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold;
558 +
559 + char buf[1024];
560 +#define set_dict_opt(val, opt) \
561 + snprintf(buf, sizeof(buf), "%i", val); \
562 + av_dict_set(&lavc_venc_opts, opt, buf, 0)
563 + set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold");
564 + set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold");
565 lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
566 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
567 if (lavc_param_packet_size)
568 @@ -870,7 +878,7 @@
569 lavc_venc_context->context_model = lavc_param_context;
570 lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
571 lavc_venc_context->noise_reduction = lavc_param_noise_reduction;
572 - lavc_venc_context->inter_threshold = lavc_param_inter_threshold;
573 + set_dict_opt(lavc_param_inter_threshold, "inter_threshold");
574 lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision;
575 lavc_venc_context->skip_top = lavc_param_skip_top;
576 lavc_venc_context->skip_bottom = lavc_param_skip_bottom;
577 @@ -887,7 +895,7 @@
578 lavc_venc_context->thread_count);
579 }
580
581 - avcodec_thread_init(lavc_venc_context, lavc_param_threads);
582 + lavc_venc_context->thread_count = lavc_param_threads;
583
584 if (lavc_param_intra_matrix) {
585 char *tmp;
586 @@ -1061,19 +1069,18 @@
587 lavc_venc_context->ildct_cmp = lavc_param_ildct_cmp;
588 lavc_venc_context->dia_size = lavc_param_dia_size;
589 lavc_venc_context->flags |= lavc_param_qpel;
590 - lavc_venc_context->flags |= lavc_param_gmc;
591 + if(lavc_param_gmc)
592 + av_dict_set(&lavc_venc_opts, "gmc", "1", 0);
593 lavc_venc_context->flags |= lavc_param_closedgop;
594 lavc_venc_context->flags |= lavc_param_trunc;
595 lavc_venc_context->flags |= lavc_param_aic;
596 - lavc_venc_context->flags |= lavc_param_umv;
597 lavc_venc_context->flags |= lavc_param_v4mv;
598 - lavc_venc_context->flags |= lavc_param_data_partitioning;
599 - lavc_venc_context->flags |= lavc_param_cbp;
600 - lavc_venc_context->flags |= lavc_param_mv0;
601 - lavc_venc_context->flags |= lavc_param_qp_rd;
602 - lavc_venc_context->flags |= lavc_param_scan_offset;
603 - lavc_venc_context->flags |= lavc_param_ss;
604 - lavc_venc_context->flags |= lavc_param_alt;
605 + if(lavc_param_cbp)
606 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+cbp_rd", 0);
607 + if(lavc_param_mv0)
608 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+mv0", 0);
609 + if(lavc_param_qp_rd)
610 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0);
611 lavc_venc_context->flags |= lavc_param_ilme;
612 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
613 lavc_venc_context->flags |= lavc_param_trell;
614 @@ -1084,7 +1091,7 @@
615 if (lavc_param_gray)
616 lavc_venc_context->flags |= CODEC_FLAG_GRAY;
617 if (lavc_param_normalize_aqp)
618 - lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP;
619 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+naq", 0);
620
621 switch(vob->encode_fields) {
622 case TC_ENCODE_FIELDS_TOP_FIRST:
623 @@ -1112,7 +1119,7 @@
624 lavc_venc_context->prediction_method = lavc_param_prediction_method;
625
626 if(is_huffyuv)
627 - lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
628 + lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
629 else
630 {
631 switch(pix_fmt)
632 @@ -1121,18 +1128,18 @@
633 case CODEC_RGB:
634 {
635 if(is_mjpeg)
636 - lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P;
637 + lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P;
638 else
639 - lavc_venc_context->pix_fmt = PIX_FMT_YUV420P;
640 + lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P;
641 break;
642 }
643
644 case CODEC_YUV422:
645 {
646 if(is_mjpeg)
647 - lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P;
648 + lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P;
649 else
650 - lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
651 + lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
652 break;
653 }
654
655 @@ -1203,9 +1210,8 @@
656
657 lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
658
659 -
660 /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
661 - if (lavc_param_video_preset) {
662 + if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) {
663 avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
664 video_codec_name = ffmpeg_codec_name(codec->name);
665
666 @@ -1241,20 +1247,39 @@
667 }
668 }
669
670 + if (lavc_param_scan_offset) {
671 + av_dict_set(&lavc_venc_opts, "scan_offset", "1", 0);
672 + }
673 +
674 + if (lavc_param_ss) {
675 + av_dict_set(&lavc_venc_opts, "structured_slices", "1", 0);
676 + }
677 +
678 + if (lavc_param_alt) {
679 + av_dict_set(&lavc_venc_opts, "alternate_scan", "1", 0);
680 + }
681 +
682 + if (lavc_param_umv) {
683 + av_dict_set(&lavc_venc_opts, "umv", "1", 0);
684 + }
685 +
686 + if (lavc_param_data_partitioning) {
687 + av_dict_set(&lavc_venc_opts, "vdpart", "1", 0);
688 + }
689
690 //-- open codec --
691 //----------------
692 TC_LOCK_LIBAVCODEC;
693 - ret = avcodec_open(lavc_venc_context, lavc_venc_codec);
694 + ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, &lavc_venc_opts);
695 TC_UNLOCK_LIBAVCODEC;
696 if (ret < 0) {
697 tc_log_warn(MOD_NAME, "could not open FFMPEG codec");
698 return TC_EXPORT_ERROR;
699 }
700
701 - if (lavc_venc_context->codec->encode == NULL) {
702 + if (av_codec_is_encoder(lavc_venc_context->codec) == 0) {
703 tc_log_warn(MOD_NAME, "could not open FFMPEG codec "
704 - "(lavc_venc_context->codec->encode == NULL)");
705 + "(av_codec_is_encoder(lavc_venc_context->codec) == 0)");
706 return TC_EXPORT_ERROR;
707 }
708
709 @@ -1574,6 +1599,8 @@
710
711 int out_size;
712 const char pict_type_char[5]= {'?', 'I', 'P', 'B', 'S'};
713 + AVPacket pkt;
714 + int ret, got_packet = 0;
715
716 if (param->flag == TC_VIDEO) {
717
718 @@ -1598,7 +1625,7 @@
719 YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT,
720 lavc_venc_context->width, lavc_venc_context->height);
721 avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
722 - PIX_FMT_YUV422P, lavc_venc_context->width,
723 + AV_PIX_FMT_YUV422P, lavc_venc_context->width,
724 lavc_venc_context->height);
725 /* FIXME: can't use tcv_convert (see decode_lavc.c) */
726 ac_imgconvert(src, IMG_YUV_DEFAULT,
727 @@ -1628,7 +1655,7 @@
728 lavc_venc_context->width,
729 lavc_venc_context->height);
730 avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
731 - PIX_FMT_YUV420P, lavc_venc_context->width,
732 + AV_PIX_FMT_YUV420P, lavc_venc_context->width,
733 lavc_venc_context->height);
734 ac_imgconvert(src, IMG_YUV422P,
735 lavc_venc_frame->data, IMG_YUV420P,
736 @@ -1639,7 +1666,7 @@
737
738 case CODEC_RGB:
739 avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
740 - PIX_FMT_YUV420P, lavc_venc_context->width,
741 + AV_PIX_FMT_YUV420P, lavc_venc_context->width,
742 lavc_venc_context->height);
743 ac_imgconvert(¶m->buffer, IMG_RGB_DEFAULT,
744 lavc_venc_frame->data, IMG_YUV420P,
745 @@ -1652,13 +1679,17 @@
746 return TC_EXPORT_ERROR;
747 }
748
749 + av_init_packet(&pkt);
750 + pkt.data = enc_buffer;
751 + pkt.size = size;
752
753 TC_LOCK_LIBAVCODEC;
754 - out_size = avcodec_encode_video(lavc_venc_context,
755 - enc_buffer, size,
756 - lavc_venc_frame);
757 + ret = avcodec_encode_video2(lavc_venc_context, &pkt,
758 + lavc_venc_frame, &got_packet);
759 TC_UNLOCK_LIBAVCODEC;
760
761 + out_size = ret ? ret : pkt.size;
762 +
763 if (out_size < 0) {
764 tc_log_warn(MOD_NAME, "encoder error: size (%d)", out_size);
765 return TC_EXPORT_ERROR;
766 --- a/export/ffmpeg_cfg.c 2011-11-19 17:50:27.000000000 +0100
767 +++ b/export/ffmpeg_cfg.c 2016-02-15 16:08:37.916488161 +0100
768 @@ -34,8 +34,6 @@
769 //int lavc_param_vqscale = 0;
770 //int lavc_param_vqmin = 2;
771 //int lavc_param_vqmax = 31;
772 -int lavc_param_mb_qmin = 2;
773 -int lavc_param_mb_qmax = 31;
774 int lavc_param_lmin = 2;
775 int lavc_param_lmax = 31;
776 int lavc_param_vqdiff = 3;
777 @@ -126,7 +124,7 @@
778 //int lavc_param_atag = 0;
779 //int lavc_param_abitrate = 224;
780
781 -char *lavc_param_video_preset = "medium";
782 +char *lavc_param_video_preset = "none";
783 char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg";
784
785 TCConfigEntry lavcopts_conf[]={
786 @@ -143,15 +141,13 @@
787 // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
788 // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
789 // {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
790 - {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
791 - {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
792 {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
793 {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
794 {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
795 {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
796 {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
797 {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
798 - {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES},
799 + {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX},
800 // {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
801 {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
802 {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
803 @@ -160,9 +156,9 @@
804 {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
805 {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
806 {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
807 - {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
808 + {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1},
809 // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
810 - {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
811 + {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY},
812 {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
813 {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
814 {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
815 @@ -211,26 +207,26 @@
816 #else
817 {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
818 #endif
819 - {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV},
820 + {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1},
821 {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
822 {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
823 {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
824 {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
825 {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
826 {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
827 - {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD},
828 - {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
829 + {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1},
830 + {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, 1},
831 {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
832 - {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
833 + {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1},
834 {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
835 - {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT},
836 - {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET},
837 - {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN},
838 + {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
839 + {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
840 + {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1},
841 {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
842 {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
843 {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
844 {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1},
845 - {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC},
846 + {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, 1},
847 {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED},
848 {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP},
849 {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16},
850 --- a/export/ffmpeg_cfg.h 2011-11-19 17:50:27.000000000 +0100
851 +++ b/export/ffmpeg_cfg.h 2016-02-15 16:08:37.916488161 +0100
852 @@ -13,8 +13,6 @@
853 //extern int lavc_param_vqscale;
854 //extern int lavc_param_vqmin;
855 //extern int lavc_param_vqmax;
856 -extern int lavc_param_mb_qmin;
857 -extern int lavc_param_mb_qmax;
858 extern int lavc_param_lmin;
859 extern int lavc_param_lmax;
860 extern int lavc_param_vqdiff;
861 --- a/filter/filter_pp.c 2011-11-19 17:50:27.000000000 +0100
862 +++ b/filter/filter_pp.c 2016-02-15 16:08:37.916488161 +0100
863 @@ -38,8 +38,8 @@
864
865 /* FIXME: these use the filter ID as an index--the ID can grow
866 * arbitrarily large, so this needs to be fixed */
867 -static pp_mode_t *mode[100];
868 -static pp_context_t *context[100];
869 +static pp_mode *mode[100];
870 +static pp_context *context[100];
871 static int width[100], height[100];
872 static int pre[100];
873
874 --- a/import/decode_lavc.c 2011-11-19 17:50:27.000000000 +0100
875 +++ b/import/decode_lavc.c 2016-02-15 16:09:00.252988897 +0100
876 @@ -58,37 +58,37 @@
877
878 // fourCC to ID mapping taken from MPlayer's codecs.conf
879 static struct ffmpeg_codec ffmpeg_codecs[] = {
880 - {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
881 + {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
882 {"MP41", "DIV1", ""}},
883 - {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
884 + {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
885 {"MP42", "DIV2", ""}},
886 - {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
887 + {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
888 {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}},
889 - {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
890 + {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
891 {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}},
892 - {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
893 + {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
894 {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}},
895 - {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video",
896 + {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video",
897 {"MPG1", ""}},
898 - {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
899 + {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
900 {"DVSD", ""}},
901 - {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
902 + {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
903 {"WMV1", ""}},
904 - {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
905 + {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
906 {"WMV2", ""}},
907 - {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
908 + {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
909 {"HFYU", ""}},
910 - {CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
911 + {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
912 {"I263", ""}},
913 - {CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
914 + {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
915 {"H263", "U263", "VIV1", ""}},
916 - {CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
917 + {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
918 {"RV10", "RV13", ""}},
919 - {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
920 + {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
921 {"SVQ1", ""}},
922 - {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
923 + {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
924 {"SVQ3", ""}},
925 - {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
926 + {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
927 {"MPG2", ""}},
928 {0, TC_CODEC_UNKNOWN, NULL, {""}}};
929
930 @@ -170,7 +170,7 @@
931
932 // Set these to the expected values so that ffmpeg's decoder can
933 // properly detect interlaced input.
934 - lavc_dec_context = avcodec_alloc_context();
935 + lavc_dec_context = avcodec_alloc_context3(NULL);
936 if (lavc_dec_context == NULL) {
937 tc_log_error(__FILE__, "Could not allocate enough memory.");
938 goto decoder_error;
939 @@ -181,12 +181,12 @@
940 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
941 lavc_dec_context->error_resilience = 2;
942 #else
943 - lavc_dec_context->error_recognition = 2;
944 + lavc_dec_context->err_recognition = 2;
945 #endif
946 lavc_dec_context->error_concealment = 3;
947 lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
948
949 - if (avcodec_open(lavc_dec_context, lavc_dec_codec) < 0) {
950 + if (avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL) < 0) {
951 tc_log_error(__FILE__, "Could not initialize the '%s' codec.",
952 codec->name);
953 goto decoder_error;
954 @@ -290,8 +290,8 @@
955
956 // Convert avcodec image to the requested YUV or RGB format
957 switch (lavc_dec_context->pix_fmt) {
958 - case PIX_FMT_YUVJ420P:
959 - case PIX_FMT_YUV420P:
960 + case AV_PIX_FMT_YUVJ420P:
961 + case AV_PIX_FMT_YUV420P:
962 // Remove "dead space" at right edge of planes, if any
963 if (picture.linesize[0] != lavc_dec_context->width) {
964 int y;
965 @@ -315,7 +315,7 @@
966 pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
967 lavc_dec_context->width, lavc_dec_context->height);
968 break;
969 - case PIX_FMT_YUV411P:
970 + case AV_PIX_FMT_YUV411P:
971 if (picture.linesize[0] != lavc_dec_context->width) {
972 int y;
973 for (y = 0; y < lavc_dec_context->height; y++) {
974 @@ -334,8 +334,8 @@
975 pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
976 lavc_dec_context->width, lavc_dec_context->height);
977 break;
978 - case PIX_FMT_YUVJ422P:
979 - case PIX_FMT_YUV422P:
980 + case AV_PIX_FMT_YUVJ422P:
981 + case AV_PIX_FMT_YUV422P:
982 if (picture.linesize[0] != lavc_dec_context->width) {
983 int y;
984 for (y = 0; y < lavc_dec_context->height; y++) {
985 @@ -354,8 +354,8 @@
986 pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
987 lavc_dec_context->width, lavc_dec_context->height);
988 break;
989 - case PIX_FMT_YUVJ444P:
990 - case PIX_FMT_YUV444P:
991 + case AV_PIX_FMT_YUVJ444P:
992 + case AV_PIX_FMT_YUV444P:
993 if (picture.linesize[0] != lavc_dec_context->width) {
994 int y;
995 for (y = 0; y < lavc_dec_context->height; y++) {
996 --- a/import/import_ffmpeg.c 2011-11-19 17:50:27.000000000 +0100
997 +++ b/import/import_ffmpeg.c 2016-02-15 16:08:48.269720627 +0100
998 @@ -59,51 +59,51 @@
999
1000 // fourCC to ID mapping taken from MPlayer's codecs.conf
1001 static struct ffmpeg_codec ffmpeg_codecs[] = {
1002 - {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
1003 + {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
1004 {"MP41", "DIV1", ""}},
1005 - {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
1006 + {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
1007 {"MP42", "DIV2", ""}},
1008 - {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
1009 + {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
1010 {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}},
1011 - {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
1012 + {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
1013 {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}},
1014 - {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
1015 + {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
1016 {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}},
1017 - {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video",
1018 + {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video",
1019 {"MPG1", ""}},
1020 - {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
1021 + {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
1022 {"DVSD", ""}},
1023 - {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
1024 + {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
1025 {"WMV1", ""}},
1026 - {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
1027 + {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
1028 {"WMV2", ""}},
1029 - {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
1030 + {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
1031 {"HFYU", ""}},
1032 - {CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
1033 + {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
1034 {"I263", ""}},
1035 - {CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
1036 + {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
1037 {"H263", "U263", "VIV1", ""}},
1038 - {CODEC_ID_H264, TC_CODEC_H264, "h264",
1039 + {AV_CODEC_ID_H264, TC_CODEC_H264, "h264",
1040 {"H264", "h264", "X264", "x264", "avc1", ""}},
1041 - {CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
1042 + {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
1043 {"RV10", "RV13", ""}},
1044 - {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
1045 + {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
1046 {"SVQ1", ""}},
1047 - {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
1048 + {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
1049 {"SVQ3", ""}},
1050 - {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
1051 + {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
1052 {"MPG2", ""}},
1053 - {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video",
1054 + {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video",
1055 {"MPG2", ""}},
1056 - {CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1",
1057 + {AV_CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1",
1058 {"ASV1", ""}},
1059 - {CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2",
1060 + {AV_CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2",
1061 {"ASV2", ""}},
1062 - {CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1",
1063 + {AV_CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1",
1064 {"FFV1", ""}},
1065 - {CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw",
1066 + {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw",
1067 {"I420", "IYUV", ""}},
1068 - {CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw",
1069 + {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw",
1070 {"Y42B", ""}},
1071 {0, TC_CODEC_UNKNOWN, NULL, {""}}};
1072
1073 @@ -302,7 +302,7 @@
1074
1075 // Set these to the expected values so that ffmpeg's decoder can
1076 // properly detect interlaced input.
1077 - lavc_dec_context = avcodec_alloc_context();
1078 + lavc_dec_context = avcodec_alloc_context3(lavc_dec_codec);
1079 if (lavc_dec_context == NULL) {
1080 tc_log_error(MOD_NAME, "Could not allocate enough memory.");
1081 return TC_IMPORT_ERROR;
1082 @@ -314,7 +314,7 @@
1083 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
1084 lavc_dec_context->error_resilience = 2;
1085 #else
1086 - lavc_dec_context->error_recognition = 2;
1087 + lavc_dec_context->err_recognition = 2;
1088 #endif
1089 lavc_dec_context->error_concealment = 3;
1090 lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
1091 @@ -324,13 +324,13 @@
1092 // XXX: some codecs need extra data
1093 switch (codec->id)
1094 {
1095 - case CODEC_ID_MJPEG: extra_data_size = 28; break;
1096 - case CODEC_ID_LJPEG: extra_data_size = 28; break;
1097 - case CODEC_ID_HUFFYUV: extra_data_size = 1000; break;
1098 - case CODEC_ID_ASV1: extra_data_size = 8; break;
1099 - case CODEC_ID_ASV2: extra_data_size = 8; break;
1100 - case CODEC_ID_WMV1: extra_data_size = 4; break;
1101 - case CODEC_ID_WMV2: extra_data_size = 4; break;
1102 + case AV_CODEC_ID_MJPEG: extra_data_size = 28; break;
1103 + case AV_CODEC_ID_LJPEG: extra_data_size = 28; break;
1104 + case AV_CODEC_ID_HUFFYUV: extra_data_size = 1000; break;
1105 + case AV_CODEC_ID_ASV1: extra_data_size = 8; break;
1106 + case AV_CODEC_ID_ASV2: extra_data_size = 8; break;
1107 + case AV_CODEC_ID_WMV1: extra_data_size = 4; break;
1108 + case AV_CODEC_ID_WMV2: extra_data_size = 4; break;
1109 default: extra_data_size = 0; break;
1110 }
1111
1112 @@ -344,7 +344,7 @@
1113 }
1114
1115 TC_LOCK_LIBAVCODEC;
1116 - ret = avcodec_open(lavc_dec_context, lavc_dec_codec);
1117 + ret = avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL);
1118 TC_UNLOCK_LIBAVCODEC;
1119 if (ret < 0) {
1120 tc_log_warn(MOD_NAME, "Could not initialize the '%s' codec.",
1121 @@ -360,7 +360,7 @@
1122 frame_size = x_dim*y_dim + 2*UV_PLANE_SIZE(IMG_YUV_DEFAULT,x_dim,y_dim);
1123
1124 // we adapt the color space
1125 - if(codec->id == CODEC_ID_MJPEG) {
1126 + if(codec->id == AV_CODEC_ID_MJPEG) {
1127 enable_levels_filter();
1128 }
1129 break;
1130 @@ -434,7 +434,7 @@
1131 }
1132
1133 // we adapt the color space
1134 - if(codec->id == CODEC_ID_MJPEG) {
1135 + if(codec->id == AV_CODEC_ID_MJPEG) {
1136 enable_levels_filter();
1137 }
1138
1139 @@ -504,13 +504,13 @@
1140 int bkey = 0;
1141
1142 // check for keyframes
1143 - if (codec->id == CODEC_ID_MSMPEG4V3) {
1144 + if (codec->id == AV_CODEC_ID_MSMPEG4V3) {
1145 if (divx3_is_key(buffer)) bkey = 1;
1146 }
1147 - else if (codec->id == CODEC_ID_MPEG4) {
1148 + else if (codec->id == AV_CODEC_ID_MPEG4) {
1149 if (mpeg4_is_key(buffer, bytes_read)) bkey = 1;
1150 }
1151 - else if (codec->id == CODEC_ID_MJPEG) {
1152 + else if (codec->id == AV_CODEC_ID_MJPEG) {
1153 bkey = 1;
1154 }
1155
1156 @@ -580,8 +580,8 @@
1157
1158 // Convert avcodec image to our internal YUV or RGB format
1159 switch (lavc_dec_context->pix_fmt) {
1160 - case PIX_FMT_YUVJ420P:
1161 - case PIX_FMT_YUV420P:
1162 + case AV_PIX_FMT_YUVJ420P:
1163 + case AV_PIX_FMT_YUV420P:
1164 src_fmt = IMG_YUV420P;
1165 YUV_INIT_PLANES(src_planes, frame, src_fmt,
1166 lavc_dec_context->width, lavc_dec_context->height);
1167 @@ -612,7 +612,7 @@
1168 }
1169 break;
1170
1171 - case PIX_FMT_YUV411P:
1172 + case AV_PIX_FMT_YUV411P:
1173 src_fmt = IMG_YUV411P;
1174 YUV_INIT_PLANES(src_planes, frame, src_fmt,
1175 lavc_dec_context->width, lavc_dec_context->height);
1176 @@ -640,8 +640,8 @@
1177 }
1178 break;
1179
1180 - case PIX_FMT_YUVJ422P:
1181 - case PIX_FMT_YUV422P:
1182 + case AV_PIX_FMT_YUVJ422P:
1183 + case AV_PIX_FMT_YUV422P:
1184 src_fmt = IMG_YUV422P;
1185 YUV_INIT_PLANES(src_planes, frame, src_fmt,
1186 lavc_dec_context->width, lavc_dec_context->height);
1187 @@ -669,8 +669,8 @@
1188 }
1189 break;
1190
1191 - case PIX_FMT_YUVJ444P:
1192 - case PIX_FMT_YUV444P:
1193 + case AV_PIX_FMT_YUVJ444P:
1194 + case AV_PIX_FMT_YUV444P:
1195 src_fmt = IMG_YUV444P;
1196 YUV_INIT_PLANES(src_planes, frame, src_fmt,
1197 lavc_dec_context->width, lavc_dec_context->height);
1198 --- a/import/probe_ffmpeg.c 2011-11-19 17:50:27.000000000 +0100
1199 +++ b/import/probe_ffmpeg.c 2016-02-15 16:08:37.917488184 +0100
1200 @@ -99,8 +99,8 @@
1201
1202 TC_INIT_LIBAVCODEC;
1203
1204 - ret = av_open_input_file(&lavf_dmx_context, ipipe->name,
1205 - NULL, 0, NULL);
1206 + ret = avformat_open_input(&lavf_dmx_context, ipipe->name,
1207 + NULL, NULL);
1208 if (ret != 0) {
1209 tc_log_error(__FILE__, "unable to open '%s'"
1210 " (libavformat failure)",
1211 @@ -109,7 +109,7 @@
1212 return;
1213 }
1214
1215 - ret = av_find_stream_info(lavf_dmx_context);
1216 + ret = avformat_find_stream_info(lavf_dmx_context, NULL);
1217 if (ret < 0) {
1218 tc_log_error(__FILE__, "unable to fetch informations from '%s'"
1219 " (libavformat failure)",
1220 @@ -120,7 +120,11 @@
1221
1222 translate_info(lavf_dmx_context, ipipe->probe_info);
1223
1224 +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(53,25,0)
1225 + avformat_close_input(&lavf_dmx_context);
1226 +#else
1227 av_close_input_file(lavf_dmx_context);
1228 +#endif
1229 return;
1230 }
1231
1232 --- a/libtc/tcavcodec.h 2011-11-19 17:50:27.000000000 +0100
1233 +++ b/libtc/tcavcodec.h 2016-02-15 16:08:37.917488184 +0100
1234 @@ -53,7 +53,6 @@
1235
1236 #define TC_INIT_LIBAVCODEC do { \
1237 TC_LOCK_LIBAVCODEC; \
1238 - avcodec_init(); \
1239 avcodec_register_all(); \
1240 TC_UNLOCK_LIBAVCODEC; \
1241 } while (0)
|