summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-12-09 23:58:06 +0100
committerMichał Górny <mgorny@gentoo.org>2017-12-10 00:13:06 +0100
commitdf877f0a7c288987b1638299f3a170092e061571 (patch)
treefa73012ab8917988aa08d625f1bd36beb5819038 /media-video/cinelerra/files
parentmedia-sound/musescore: [QA] Move patches to distfiles (diff)
downloadgentoo-df877f0a7c288987b1638299f3a170092e061571.tar.gz
gentoo-df877f0a7c288987b1638299f3a170092e061571.tar.bz2
gentoo-df877f0a7c288987b1638299f3a170092e061571.zip
media-video/cinelerra: [QA] Move patches to a distfile
Closes: https://bugs.gentoo.org/620600
Diffstat (limited to 'media-video/cinelerra/files')
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch134
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-underlinking.patch16
-rw-r--r--media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch14
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg.patch76
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg2.patch218
-rw-r--r--media-video/cinelerra/files/cinelerra-ffmpeg29.patch658
-rw-r--r--media-video/cinelerra/files/cinelerra-implicit_decls.patch36
-rw-r--r--media-video/cinelerra/files/cinelerra-includes.patch12
-rw-r--r--media-video/cinelerra/files/cinelerra-libav9.patch93
-rw-r--r--media-video/cinelerra/files/cinelerra-pngtoh.patch15
-rw-r--r--media-video/cinelerra/files/cinelerra-putbits-gcc52.patch29
11 files changed, 0 insertions, 1301 deletions
diff --git a/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch b/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch
deleted file mode 100644
index 2aebd7008c3..00000000000
--- a/media-video/cinelerra/files/cinelerra-20140710-ffmpeg-0.11.patch
+++ /dev/null
@@ -1,134 +0,0 @@
---- cinelerra/ffmpeg.C
-+++ cinelerra/ffmpeg.C
-@@ -23,7 +23,6 @@
-
- int FFMPEG::init(char *codec_string) {
-
-- avcodec_init();
- avcodec_register_all();
-
- CodecID id = codec_id(codec_string);
---- cinelerra/fileac3.C
-+++ cinelerra/fileac3.C
-@@ -84,7 +84,6 @@
-
- if(wr)
- {
-- avcodec_init();
- avcodec_register_all();
- codec = avcodec_find_encoder(CODEC_ID_AC3);
- if(!codec)
---- configure.ac
-+++ configure.ac
-@@ -497,7 +497,7 @@
- AC_ARG_WITH([external-ffmpeg], AC_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
-
- if test "x$with_external_ffmpeg" = "xyes"; then
-- PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc])
-+ PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc libavutil])
- FFMPEG_FOLDER=""
- FFMPEG_EXTERNALTEXT="External ffmpeg"
-
-@@ -515,10 +515,10 @@
- AC_MSG_RESULT($enable_ffmpeg_swscale)
- if test x"$enable_ffmpeg_swscale" = xyes; then
- dnl AC_DEFINE(HAVE_SWSCALER)
-- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale])
-+ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale libavutil])
- FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER"
- else
-- PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc])
-+ PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libavutil])
- fi
- FFMPEG_EXTERNALTEXT="External ffmpeg"
- else
---- quicktime/mpeg4.c
-+++ quicktime/mpeg4.c
-@@ -624,12 +624,12 @@
- else
- // ffmpeg section
- {
-+ AVDictionary ** opts = NULL;
- static char *video_rc_eq="tex^qComp";
- codec->encode_initialized[current_field] = 1;
- if(!ffmpeg_initialized)
- {
- ffmpeg_initialized = 1;
-- avcodec_init();
- avcodec_register_all();
- }
-
-@@ -673,8 +673,10 @@
- context->b_quant_offset = 1.25;
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
- context->error_resilience = FF_ER_CAREFUL;
--#else
-+#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
- context->error_recognition = FF_ER_CAREFUL;
-+#else
-+ context->err_recognition |= AV_EF_CAREFUL;
- #endif
- context->error_concealment = 3;
- context->frame_skip_cmp = FF_CMP_DCTMAX;
-@@ -699,7 +701,7 @@
- context->profile= FF_PROFILE_UNKNOWN;
- context->rc_buffer_aggressivity = 1.0;
- context->level= FF_LEVEL_UNKNOWN;
-- context->flags |= CODEC_FLAG_H263P_UMV;
-+ av_dict_set(opts, "umv", "1", 0);
- context->flags |= CODEC_FLAG_AC_PRED;
-
- // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
-@@ -717,10 +719,8 @@
- (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
- codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
- codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
-- codec->ffmpeg_id == CODEC_ID_H263P ||
-- codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
-+ codec->ffmpeg_id == CODEC_ID_H263P ))
- {
-- avcodec_thread_init(context, file->cpus);
- context->thread_count = file->cpus;
- }
-
-@@ -740,7 +740,7 @@
- * codec->fix_bitrate,
- * codec->quantizer);
- */
-- avcodec_open(context, codec->encoder[current_field]);
-+ avcodec_open2(context, codec->encoder[current_field], opts);
-
- avcodec_get_frame_defaults(&codec->picture[current_field]);
-
---- quicktime/qtffmpeg.c
-+++ quicktime/qtffmpeg.c
-@@ -54,7 +54,6 @@
- if(!ffmpeg_initialized)
- {
- ffmpeg_initialized = 1;
-- avcodec_init();
- avcodec_register_all();
- }
-
-@@ -90,10 +89,8 @@
- (ffmpeg_id == CODEC_ID_MPEG4 ||
- ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
- ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
-- ffmpeg_id == CODEC_ID_H263P ||
-- ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
-+ ffmpeg_id == CODEC_ID_H263P ))
- {
-- avcodec_thread_init(context, cpus);
- context->thread_count = cpus;
- }
- if(avcodec_open(context,
---- quicktime/wma.c
-+++ quicktime/wma.c
-@@ -67,7 +67,6 @@
- if(!ffmpeg_initialized)
- {
- ffmpeg_initialized = 1;
-- avcodec_init();
- avcodec_register_all();
- }
-
diff --git a/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch b/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch
deleted file mode 100644
index a7dc74f2d44..00000000000
--- a/media-video/cinelerra/files/cinelerra-20140710-underlinking.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-http://bugs.gentoo.org/367509
-
-pluginserver.C is using dlsym, dlopen, dlclose and dlerror
-
---- cinelerra/Makefile.am
-+++ cinelerra/Makefile.am
-@@ -692,7 +692,8 @@
- $(LIBDV_LIBS) \
- -luuid \
- $(MJPEG_LIBS) \
-- -lstdc++
-+ -lstdc++ \
-+ -ldl
-
- EXTRA_DIST = gen-feather-h
-
diff --git a/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch b/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch
deleted file mode 100644
index 00621758663..00000000000
--- a/media-video/cinelerra/files/cinelerra-20140710-validate_desktop_entry.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- image/cinelerra-cv.desktop
-+++ image/cinelerra-cv.desktop
-@@ -5,9 +5,8 @@
- Name[fr]=Cinelerra-CV
- Name[es]=Cinelerra-CV
- Comment=Video Editor
--Categories=Application;AudioVideo;Multimedia;VideoEditing;
--Encoding=UTF-8
-+Categories=AudioVideo;
- Exec=cinelerra
--Icon=cinelerra-cv.xpm
-+Icon=cinelerra-cv
- Terminal=false
- Type=Application
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg.patch b/media-video/cinelerra/files/cinelerra-ffmpeg.patch
deleted file mode 100644
index 6f7962fb1a5..00000000000
--- a/media-video/cinelerra/files/cinelerra-ffmpeg.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-Fix build with ffmpeg/libav trunk / 0.7
-
-Index: cinelerra-20101104/cinelerra/ffmpeg.C
-===================================================================
---- cinelerra-20101104.orig/cinelerra/ffmpeg.C
-+++ cinelerra-20101104/cinelerra/ffmpeg.C
-@@ -364,12 +364,15 @@ int FFMPEG::decode(uint8_t *data, long d
-
- // NOTE: frame must already have data space allocated
-
-+ AVPacket pkt;
- got_picture = 0;
-- int length = avcodec_decode_video(context,
-+ av_init_packet( &pkt );
-+ pkt.data = data;
-+ pkt.size = data_size;
-+ int length = avcodec_decode_video2(context,
- picture,
- &got_picture,
-- data,
-- data_size);
-+ &pkt);
-
- if (length < 0) {
- printf("FFMPEG::decode error decoding frame\n");
-Index: cinelerra-20101104/quicktime/qtffmpeg.c
-===================================================================
---- cinelerra-20101104.orig/quicktime/qtffmpeg.c
-+++ cinelerra-20101104/quicktime/qtffmpeg.c
-@@ -181,6 +181,7 @@ static int decode_wrapper(quicktime_t *f
-
- if(!result)
- {
-+ AVPacket pkt;
-
-
- // No way to determine if there was an error based on nonzero status.
-@@ -189,11 +190,13 @@ static int decode_wrapper(quicktime_t *f
- ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_NONREF /* AVDISCARD_BIDIR */;
- else
- ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_DEFAULT;
-- result = avcodec_decode_video(ffmpeg->decoder_context[current_field],
-+ av_init_packet( &pkt );
-+ pkt.data = ffmpeg->work_buffer;
-+ pkt.size = bytes + header_bytes;
-+ result = avcodec_decode_video2(ffmpeg->decoder_context[current_field],
- &ffmpeg->picture[current_field],
- &got_picture,
-- ffmpeg->work_buffer,
-- bytes + header_bytes);
-+ &pkt);
-
-
-
-Index: cinelerra-20101104/quicktime/wma.c
-===================================================================
---- cinelerra-20101104.orig/quicktime/wma.c
-+++ cinelerra-20101104/quicktime/wma.c
-@@ -195,11 +195,14 @@ printf("decode 2 %x %llx %llx\n", chunk_
- chunk_size);
- #else
- bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-- result = avcodec_decode_audio2(codec->decoder_context,
-+ AVPacket pkt;
-+ av_init_packet( &pkt );
-+ pkt.data = codec->packet_buffer;
-+ pkt.size = chunk_size;
-+ result = avcodec_decode_audio3(codec->decoder_context,
- (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
- &bytes_decoded,
-- codec->packet_buffer,
-- chunk_size);
-+ &pkt);
- #endif
-
- pthread_mutex_unlock(&ffmpeg_lock);
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg2.patch b/media-video/cinelerra/files/cinelerra-ffmpeg2.patch
deleted file mode 100644
index 01680ac952f..00000000000
--- a/media-video/cinelerra/files/cinelerra-ffmpeg2.patch
+++ /dev/null
@@ -1,218 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=479394
-By Helmut Jarausch
-
---- cinelerra/ffmpeg.h.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ cinelerra/ffmpeg.h 2013-08-01 12:58:12.342474136 +0200
-@@ -26,7 +26,7 @@
- static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out);
- static int init_picture_from_frame(AVPicture *picture, VFrame *frame);
-
-- static CodecID codec_id(char *codec_string);
-+ static AVCodecID codec_id(char *codec_string);
-
- private:
- static PixelFormat color_model_to_pix_fmt(int color_model);
---- cinelerra/ffmpeg.C.ORIG 2013-08-01 11:24:43.794419246 +0200
-+++ cinelerra/ffmpeg.C 2013-08-01 12:57:48.121473899 +0200
-@@ -25,7 +25,7 @@
-
- avcodec_register_all();
-
-- CodecID id = codec_id(codec_string);
-+ AVCodecID id = codec_id(codec_string);
- codec = avcodec_find_decoder(id);
- if (codec == NULL) {
- printf("FFMPEG::init no decoder for '%s'", codec_string);
-@@ -51,7 +51,7 @@
- }
-
-
--CodecID FFMPEG::codec_id(char *codec_string) {
-+AVCodecID FFMPEG::codec_id(char *codec_string) {
- #define CODEC_IS(x) (! strncmp(codec_string, x, 4))
-
- if (CODEC_IS(QUICKTIME_DV) ||
---- quicktime/ffmpeg/ffmpeg.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/ffmpeg.c 2013-08-01 12:57:59.025474005 +0200
-@@ -2663,7 +2663,7 @@
- return 0;
- }
-
--static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
-+static enum AVCodecID find_codec_or_die(const char *name, int type, int encoder)
- {
- const char *codec_string = encoder ? "encoder" : "decoder";
- AVCodec *codec;
---- quicktime/ffmpeg/libavformat/electronicarts.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/electronicarts.c 2013-08-01 13:00:57.855475755 +0200
-@@ -49,11 +49,11 @@
- typedef struct EaDemuxContext {
- int big_endian;
-
-- enum CodecID video_codec;
-+ enum AVCodecID video_codec;
- AVRational time_base;
- int video_stream_index;
-
-- enum CodecID audio_codec;
-+ enum AVCodecID audio_codec;
- int audio_stream_index;
- int audio_frame_counter;
-
---- quicktime/ffmpeg/libavformat/img2.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/img2.c 2013-08-01 12:59:21.408474812 +0200
-@@ -34,7 +34,7 @@
- } VideoData;
-
- typedef struct {
-- enum CodecID id;
-+ enum AVCodecID id;
- const char *str;
- } IdStrMap;
-
-@@ -97,7 +97,7 @@
- }
- return -1;
- }
--static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
-+static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str)
- {
- str= strrchr(str, '.');
- if(!str) return CODEC_ID_NONE;
-@@ -175,7 +175,7 @@
- return 0;
- }
-
--enum CodecID av_guess_image2_codec(const char *filename){
-+enum AVCodecID av_guess_image2_codec(const char *filename){
- return av_str2id(img_tags, filename);
- }
-
---- quicktime/ffmpeg/libavformat/matroskadec.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/matroskadec.c 2013-08-01 12:59:57.556475165 +0200
-@@ -2476,7 +2476,7 @@
- AVStream *st;
-
- for (i = 0; i < matroska->num_tracks; i++) {
-- enum CodecID codec_id = CODEC_ID_NONE;
-+ enum AVCodecID codec_id = CODEC_ID_NONE;
- uint8_t *extradata = NULL;
- int extradata_size = 0;
- int extradata_offset = 0;
-@@ -2495,7 +2495,7 @@
- }
- }
-
-- /* Set the FourCC from the CodecID. */
-+ /* Set the FourCC from the AVCodecID. */
- /* This is the MS compatibility mode which stores a
- * BITMAPINFOHEADER in the CodecPrivate. */
- if (!strcmp(track->codec_id,
-@@ -2600,7 +2600,7 @@
-
- if (codec_id == CODEC_ID_NONE) {
- av_log(matroska->ctx, AV_LOG_INFO,
-- "Unknown/unsupported CodecID %s.\n",
-+ "Unknown/unsupported AVCodecID %s.\n",
- track->codec_id);
- }
-
---- quicktime/ffmpeg/libavformat/matroska.h.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/matroska.h 2013-08-01 13:00:22.218475407 +0200
-@@ -220,12 +220,12 @@
-
- typedef struct CodecTags{
- char str[16];
-- enum CodecID id;
-+ enum AVCodecID id;
- }CodecTags;
-
- typedef struct CodecMime{
- char str[32];
-- enum CodecID id;
-+ enum AVCodecID id;
- }CodecMime;
-
- #define MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
---- quicktime/ffmpeg/libavformat/mov.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/mov.c 2013-08-01 12:59:33.935474934 +0200
-@@ -678,7 +678,7 @@
-
- for(pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) {
- //Parsing Sample description table
-- enum CodecID id;
-+ enum AVCodecID id;
- int dref_id;
- MOV_atom_t a = { 0, 0, 0 };
- offset_t start_pos = url_ftell(pb);
---- quicktime/ffmpeg/libavformat/mxf.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/mxf.c 2013-08-01 12:59:12.025474720 +0200
-@@ -157,7 +157,7 @@
- typedef struct {
- UID uid;
- unsigned matching_len;
-- enum CodecID id;
-+ enum AVCodecID id;
- } MXFCodecUL;
-
- typedef struct {
---- quicktime/ffmpeg/libavformat/riff.h.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/riff.h 2013-08-01 12:59:45.950475052 +0200
-@@ -48,7 +48,7 @@
- extern const AVCodecTag codec_wav_tags[];
-
- unsigned int codec_get_tag(const AVCodecTag *tags, int id);
--enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
-+enum AVCodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
- void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
-
- #endif /* FFMPEG_RIFF_H */
---- quicktime/ffmpeg/libavformat/rtp.c.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/rtp.c 2013-08-01 12:59:01.778474619 +0200
-@@ -40,7 +40,7 @@
- int pt;
- const char enc_name[6];
- enum CodecType codec_type;
-- enum CodecID codec_id;
-+ enum AVCodecID codec_id;
- int clock_rate;
- int audio_channels;
- } AVRtpPayloadTypes[]=
-@@ -120,7 +120,7 @@
- return "";
- }
-
--enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
-+enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
- {
- int i;
-
---- quicktime/ffmpeg/libavformat/rtp_internal.h.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/ffmpeg/libavformat/rtp_internal.h 2013-08-01 13:00:09.147475279 +0200
-@@ -61,7 +61,7 @@
- // fields from AVRtpDynamicPayloadType_s
- const char enc_name[50]; /* XXX: still why 50 ? ;-) */
- enum CodecType codec_type;
-- enum CodecID codec_id;
-+ enum AVCodecID codec_id;
-
- // may be null
- int (*parse_sdp_a_line) (AVStream * stream,
-@@ -123,7 +123,7 @@
-
- void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
- const char *ff_rtp_enc_name(int payload_type);
--enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
-+enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
-
- void av_register_rtp_dynamic_payload_handlers(void);
-
---- quicktime/wma.h.ORIG 2012-07-06 22:40:26.000000000 +0200
-+++ quicktime/wma.h 2013-08-01 13:11:46.431482103 +0200
-@@ -3,5 +3,6 @@
-
- extern void quicktime_init_codec_wmav1(quicktime_audio_map_t *);
- extern void quicktime_init_codec_wmav2(quicktime_audio_map_t *);
-+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
-
- #endif
diff --git a/media-video/cinelerra/files/cinelerra-ffmpeg29.patch b/media-video/cinelerra/files/cinelerra-ffmpeg29.patch
deleted file mode 100644
index 604000eff38..00000000000
--- a/media-video/cinelerra/files/cinelerra-ffmpeg29.patch
+++ /dev/null
@@ -1,658 +0,0 @@
-Index: cinelerra-20140710/cinelerra/ffmpeg.C
-===================================================================
---- cinelerra-20140710.orig/cinelerra/ffmpeg.C
-+++ cinelerra-20140710/cinelerra/ffmpeg.C
-@@ -38,7 +38,7 @@ int FFMPEG::init(char *codec_string) {
- printf("FFMPEG::init avcodec_open() failed\n");
- }
-
-- picture = avcodec_alloc_frame();
-+ picture = av_frame_alloc();
-
-
- return 0;
-@@ -55,62 +55,62 @@ AVCodecID FFMPEG::codec_id(char *codec_s
- #define CODEC_IS(x) (! strncmp(codec_string, x, 4))
-
- if (CODEC_IS(QUICKTIME_DV) ||
-- CODEC_IS(QUICKTIME_DVSD)) return CODEC_ID_DVVIDEO;
-+ CODEC_IS(QUICKTIME_DVSD)) return AV_CODEC_ID_DVVIDEO;
-
- if (CODEC_IS(QUICKTIME_MP4V) ||
-- CODEC_IS(QUICKTIME_DIVX)) return CODEC_ID_MPEG4;
-+ CODEC_IS(QUICKTIME_DIVX)) return AV_CODEC_ID_MPEG4;
-
-- return CODEC_ID_NONE;
-+ return AV_CODEC_ID_NONE;
-
- #undef CODEC_IS
- }
-
--PixelFormat FFMPEG::color_model_to_pix_fmt(int color_model) {
-+AVPixelFormat FFMPEG::color_model_to_pix_fmt(int color_model) {
- switch (color_model)
- {
- case BC_YUV422:
-- return PIX_FMT_YUYV422;
-+ return AV_PIX_FMT_YUYV422;
- case BC_RGB888:
-- return PIX_FMT_RGB24;
-+ return AV_PIX_FMT_RGB24;
- case BC_BGR8888: // NOTE: order flipped
-- return PIX_FMT_RGB32;
-+ return AV_PIX_FMT_RGB32;
- case BC_BGR888:
-- return PIX_FMT_BGR24;
-+ return AV_PIX_FMT_BGR24;
- case BC_YUV420P:
-- return PIX_FMT_YUV420P;
-+ return AV_PIX_FMT_YUV420P;
- case BC_YUV422P:
-- return PIX_FMT_YUV422P;
-+ return AV_PIX_FMT_YUV422P;
- case BC_YUV444P:
-- return PIX_FMT_YUV444P;
-+ return AV_PIX_FMT_YUV444P;
- case BC_YUV411P:
-- return PIX_FMT_YUV411P;
-+ return AV_PIX_FMT_YUV411P;
- case BC_RGB565:
-- return PIX_FMT_RGB565;
-+ return AV_PIX_FMT_RGB565;
- };
-
-- return PIX_FMT_NB;
-+ return AV_PIX_FMT_NB;
- }
-
--int FFMPEG::pix_fmt_to_color_model(PixelFormat pix_fmt) {
-+int FFMPEG::pix_fmt_to_color_model(AVPixelFormat pix_fmt) {
- switch (pix_fmt)
- {
-- case PIX_FMT_YUYV422:
-+ case AV_PIX_FMT_YUYV422:
- return BC_YUV422;
-- case PIX_FMT_RGB24:
-+ case AV_PIX_FMT_RGB24:
- return BC_RGB888;
-- case PIX_FMT_RGB32:
-+ case AV_PIX_FMT_RGB32:
- return BC_BGR8888;
-- case PIX_FMT_BGR24:
-+ case AV_PIX_FMT_BGR24:
- return BC_BGR888;
-- case PIX_FMT_YUV420P:
-+ case AV_PIX_FMT_YUV420P:
- return BC_YUV420P;
-- case PIX_FMT_YUV422P:
-+ case AV_PIX_FMT_YUV422P:
- return BC_YUV422P;
-- case PIX_FMT_YUV444P:
-+ case AV_PIX_FMT_YUV444P:
- return BC_YUV444P;
-- case PIX_FMT_YUV411P:
-+ case AV_PIX_FMT_YUV411P:
- return BC_YUV411P;
-- case PIX_FMT_RGB565:
-+ case AV_PIX_FMT_RGB565:
- return BC_RGB565;
- };
-
-@@ -119,7 +119,7 @@ int FFMPEG::pix_fmt_to_color_model(Pixel
-
- int FFMPEG::init_picture_from_frame(AVPicture *picture, VFrame *frame) {
- int cmodel = frame->get_color_model();
-- PixelFormat pix_fmt = color_model_to_pix_fmt(cmodel);
-+ AVPixelFormat pix_fmt = color_model_to_pix_fmt(cmodel);
-
- int size = avpicture_fill(picture, frame->get_data(), pix_fmt,
- frame->get_w(), frame->get_h());
-@@ -142,16 +142,16 @@ int FFMPEG::init_picture_from_frame(AVPi
-
- int FFMPEG::convert_cmodel(VFrame *frame_in, VFrame *frame_out) {
-
-- PixelFormat pix_fmt_in =
-+ AVPixelFormat pix_fmt_in =
- color_model_to_pix_fmt(frame_in->get_color_model());
-- PixelFormat pix_fmt_out =
-+ AVPixelFormat pix_fmt_out =
- color_model_to_pix_fmt(frame_out->get_color_model());
- #ifdef HAVE_SWSCALER
- // We need a context for swscale
- struct SwsContext *convert_ctx;
- #endif
- // do conversion within libavcodec if possible
-- if (pix_fmt_in != PIX_FMT_NB && pix_fmt_out != PIX_FMT_NB) {
-+ if (pix_fmt_in != AV_PIX_FMT_NB && pix_fmt_out != AV_PIX_FMT_NB) {
- // set up a temporary pictures from frame_in and frame_out
- AVPicture picture_in, picture_out;
- init_picture_from_frame(&picture_in, frame_in);
-@@ -226,14 +226,14 @@ int FFMPEG::convert_cmodel_transfer(VFra
- }
-
-
--int FFMPEG::convert_cmodel(AVPicture *picture_in, PixelFormat pix_fmt_in,
-+int FFMPEG::convert_cmodel(AVPicture *picture_in, AVPixelFormat pix_fmt_in,
- int width_in, int height_in, VFrame *frame_out) {
-
- // set up a temporary picture_out from frame_out
- AVPicture picture_out;
- init_picture_from_frame(&picture_out, frame_out);
- int cmodel_out = frame_out->get_color_model();
-- PixelFormat pix_fmt_out = color_model_to_pix_fmt(cmodel_out);
-+ AVPixelFormat pix_fmt_out = color_model_to_pix_fmt(cmodel_out);
-
- #ifdef HAVE_SWSCALER
- // We need a context for swscale
-@@ -242,7 +242,7 @@ int FFMPEG::convert_cmodel(AVPicture *pi
- int result;
- #ifndef HAVE_SWSCALER
- // do conversion within libavcodec if possible
-- if (pix_fmt_out != PIX_FMT_NB) {
-+ if (pix_fmt_out != AV_PIX_FMT_NB) {
- result = img_convert(&picture_out,
- pix_fmt_out,
- picture_in,
-@@ -280,7 +280,7 @@ int FFMPEG::convert_cmodel(AVPicture *pi
- // make an intermediate temp frame only if necessary
- int cmodel_in = pix_fmt_to_color_model(pix_fmt_in);
- if (cmodel_in == BC_TRANSPARENCY) {
-- if (pix_fmt_in == PIX_FMT_RGB32) {
-+ if (pix_fmt_in == AV_PIX_FMT_RGB32) {
- // avoid infinite recursion if things are broken
- printf("FFMPEG::convert_cmodel pix_fmt_in broken!\n");
- return 1;
-Index: cinelerra-20140710/cinelerra/ffmpeg.h
-===================================================================
---- cinelerra-20140710.orig/cinelerra/ffmpeg.h
-+++ cinelerra-20140710/cinelerra/ffmpeg.h
-@@ -18,7 +18,7 @@ class FFMPEG
- int init(char *codec_string);
- int decode(uint8_t *data, long data_size, VFrame *frame_out);
-
-- static int convert_cmodel(AVPicture *picture_in, PixelFormat pix_fmt,
-+ static int convert_cmodel(AVPicture *picture_in, AVPixelFormat pix_fmt,
- int width_in, int height_in,
- VFrame *frame_out);
- static int convert_cmodel(VFrame *frame_in, VFrame *frame_out);
-@@ -29,8 +29,8 @@ class FFMPEG
- static AVCodecID codec_id(char *codec_string);
-
- private:
-- static PixelFormat color_model_to_pix_fmt(int color_model);
-- static int pix_fmt_to_color_model(PixelFormat pix_fmt);
-+ static AVPixelFormat color_model_to_pix_fmt(int color_model);
-+ static int pix_fmt_to_color_model(AVPixelFormat pix_fmt);
-
- int got_picture;
- Asset *asset;
-Index: cinelerra-20140710/cinelerra/fileac3.C
-===================================================================
---- cinelerra-20140710.orig/cinelerra/fileac3.C
-+++ cinelerra-20140710/cinelerra/fileac3.C
-@@ -85,7 +85,7 @@ int FileAC3::open_file(int rd, int wr)
- if(wr)
- {
- avcodec_register_all();
-- codec = avcodec_find_encoder(CODEC_ID_AC3);
-+ codec = avcodec_find_encoder(AV_CODEC_ID_AC3);
- if(!codec)
- {
- eprintf("codec not found.\n");
-@@ -211,12 +211,56 @@ int FileAC3::write_samples(double **buff
- current_sample + frame_size <= temp_raw_size;
- current_sample += frame_size)
- {
-- int compressed_size = avcodec_encode_audio(
-- codec_context,
-- temp_compressed + output_size,
-- compressed_allocated - output_size,
-- temp_raw + current_sample * asset->channels);
-- output_size += compressed_size;
-+ AVPacket pkt;
-+ AVFrame *frame;
-+ int ret, samples_size, got_packet;
-+ av_init_packet(&pkt);
-+ pkt.data = temp_compressed + output_size;
-+ pkt.size = compressed_allocated - output_size;
-+ frame = av_frame_alloc();
-+ if(!frame) return AVERROR(ENOMEM);
-+ if(codec_context->frame_size) {
-+ frame->nb_samples = codec_context->frame_size;
-+ } else {
-+ /* if frame_size is not set, the number of samples must be
-+ * * calculated from the buffer size */
-+ int64_t nb_samples;
-+ if (!av_get_bits_per_sample(codec_context->codec_id)) {
-+ av_frame_free(&frame);
-+ return AVERROR(EINVAL);
-+ }
-+ nb_samples = (int64_t)(compressed_allocated - output_size) * 8 /
-+ (av_get_bits_per_sample(codec_context->codec_id) *
-+ codec_context->channels);
-+ if (nb_samples >= INT_MAX) {
-+ av_frame_free(&frame);
-+ return AVERROR(EINVAL);
-+ }
-+ frame->nb_samples = nb_samples;
-+ }
-+
-+ /* it is assumed that the samples buffer is large enough based on the
-+ * * relevant parameters */
-+ samples_size = av_samples_get_buffer_size(NULL, codec_context->channels,
-+ frame->nb_samples,
-+ codec_context->sample_fmt, 1);
-+ if ((ret = avcodec_fill_audio_frame(frame, codec_context->channels,
-+ codec_context->sample_fmt,
-+ (const uint8_t *)(temp_raw + current_sample * asset->channels),
-+ samples_size, 1)) < 0) {
-+ av_frame_free(&frame);
-+ return ret;
-+ }
-+
-+ ret = avcodec_encode_audio2(codec_context, &pkt, frame, &got_packet);
-+ output_size += pkt.size;
-+ /* free any side data since we cannot return it */
-+ av_packet_free_side_data(&pkt);
-+
-+ if (frame && frame->extended_data != frame->data)
-+ av_freep(&frame->extended_data);
-+
-+ av_frame_free(&frame);
- }
-
- // Shift buffer back
-Index: cinelerra-20140710/quicktime/mpeg4.c
-===================================================================
---- cinelerra-20140710.orig/quicktime/mpeg4.c
-+++ cinelerra-20140710/quicktime/mpeg4.c
-@@ -595,7 +595,7 @@ static int encode(quicktime_t *file, uns
- if(!codec->encode_initialized[current_field])
- {
- // Encore section
-- if(codec->ffmpeg_id == CODEC_ID_MPEG4 && codec->use_encore)
-+ if(codec->ffmpeg_id == AV_CODEC_ID_MPEG4 && codec->use_encore)
- {
- codec->encode_initialized[current_field] = 1;
- codec->encode_handle[current_field] = encode_handle++;
-@@ -647,7 +647,7 @@ static int encode(quicktime_t *file, uns
- context->width = width_i;
- context->height = height_i;
- context->gop_size = codec->gop_size;
-- context->pix_fmt = PIX_FMT_YUV420P;
-+ context->pix_fmt = AV_PIX_FMT_YUV420P;
- context->bit_rate = codec->bitrate / codec->total_fields;
- context->bit_rate_tolerance = codec->bitrate_tolerance;
- context->rc_eq = video_rc_eq;
-@@ -705,19 +705,19 @@ static int encode(quicktime_t *file, uns
- // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
-
- // Copyed from ffmpeg's mpegvideo.c... set 4MV only where it is supported
-- if(codec->ffmpeg_id == CODEC_ID_MPEG4 ||
-- codec->ffmpeg_id == CODEC_ID_H263 ||
-- codec->ffmpeg_id == CODEC_ID_H263P ||
-- codec->ffmpeg_id == CODEC_ID_FLV1)
-+ if(codec->ffmpeg_id == AV_CODEC_ID_MPEG4 ||
-+ codec->ffmpeg_id == AV_CODEC_ID_H263 ||
-+ codec->ffmpeg_id == AV_CODEC_ID_H263P ||
-+ codec->ffmpeg_id == AV_CODEC_ID_FLV1)
- context->flags |= CODEC_FLAG_4MV;
- // Not compatible with Win
- // context->flags |= CODEC_FLAG_QPEL;
-
- if(file->cpus > 1 &&
-- (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
-- codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
-- codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
-- codec->ffmpeg_id == CODEC_ID_H263P ))
-+ (codec->ffmpeg_id == AV_CODEC_ID_MPEG4 ||
-+ codec->ffmpeg_id == AV_CODEC_ID_MPEG1VIDEO ||
-+ codec->ffmpeg_id == AV_CODEC_ID_MPEG2VIDEO ||
-+ codec->ffmpeg_id == AV_CODEC_ID_H263P ))
- {
- context->thread_count = file->cpus;
- }
-@@ -740,7 +740,7 @@ static int encode(quicktime_t *file, uns
- */
- avcodec_open2(context, codec->encoder[current_field], opts);
-
-- avcodec_get_frame_defaults(&codec->picture[current_field]);
-+ av_frame_unref(&codec->picture[current_field]);
-
- }
- }
-@@ -891,10 +891,18 @@ static int encode(quicktime_t *file, uns
- picture->quality = 0;
- picture->pts = vtrack->current_position * quicktime_frame_rate_d(file, track);
- picture->key_frame = 0;
-- bytes = avcodec_encode_video(context,
-- codec->work_buffer,
-- codec->buffer_size,
-- picture);
-+
-+ AVPacket pkt;
-+ int ret, got_pkt;
-+ av_init_packet(&pkt);
-+ pkt.data = codec->work_buffer;
-+ pkt.size = codec->buffer_size;
-+ ret = avcodec_encode_video2(context,
-+ &pkt,
-+ picture, &got_pkt);
-+ bytes = pkt.size;
-+ if(ret < 0 || !got_pkt) return 1;
-+
- is_keyframe = context->coded_frame && context->coded_frame->key_frame;
- /*
- * printf("encode current_position=%d is_keyframe=%d\n",
-@@ -1161,7 +1169,7 @@ void quicktime_init_codec_div3(quicktime
- QUICKTIME_DIV3,
- "DIVX",
- "Mike Row Soft MPEG4 Version 3");
-- result->ffmpeg_id = CODEC_ID_MSMPEG4V3;
-+ result->ffmpeg_id = AV_CODEC_ID_MSMPEG4V3;
- }
-
- void quicktime_init_codec_div5(quicktime_video_map_t *vtrack)
-@@ -1170,7 +1178,7 @@ void quicktime_init_codec_div5(quicktime
- QUICKTIME_DX50,
- "DIVX",
- "Mike Row Soft MPEG4 Version 5");
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- }
-
- // Mike Rowe Soft MPEG-4
-@@ -1180,7 +1188,7 @@ void quicktime_init_codec_div3lower(quic
- QUICKTIME_DIV3_LOWER,
- "DIVX",
- "Mike Row Soft MPEG4 Version 3");
-- result->ffmpeg_id = CODEC_ID_MSMPEG4V3;
-+ result->ffmpeg_id = AV_CODEC_ID_MSMPEG4V3;
- }
-
- void quicktime_init_codec_div3v2(quicktime_video_map_t *vtrack)
-@@ -1189,7 +1197,7 @@ void quicktime_init_codec_div3v2(quickti
- QUICKTIME_MP42,
- "MP42",
- "Mike Row Soft MPEG4 Version 2");
-- result->ffmpeg_id = CODEC_ID_MSMPEG4V2;
-+ result->ffmpeg_id = AV_CODEC_ID_MSMPEG4V2;
- }
-
- // Generic MPEG-4
-@@ -1199,7 +1207,7 @@ void quicktime_init_codec_divx(quicktime
- QUICKTIME_DIVX,
- "MPEG-4",
- "Generic MPEG Four");
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- result->use_encore = 1;
- }
-
-@@ -1209,7 +1217,7 @@ void quicktime_init_codec_mpg4(quicktime
- QUICKTIME_MPG4,
- "MPEG-4",
- "FFMPEG (msmpeg4)");
-- result->ffmpeg_id = CODEC_ID_MSMPEG4V1;
-+ result->ffmpeg_id = AV_CODEC_ID_MSMPEG4V1;
- }
-
- void quicktime_init_codec_dx50(quicktime_video_map_t *vtrack)
-@@ -1218,7 +1226,7 @@ void quicktime_init_codec_dx50(quicktime
- QUICKTIME_DX50,
- "MPEG-4",
- "FFMPEG (mpeg4)");
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- }
-
- // Generic MPEG-4
-@@ -1228,7 +1236,7 @@ void quicktime_init_codec_mp4v(quicktime
- QUICKTIME_MP4V,
- "MPEG4",
- "Generic MPEG Four");
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- // result->use_encore = 1;
- }
-
-@@ -1240,7 +1248,7 @@ void quicktime_init_codec_svq1(quicktime
- QUICKTIME_SVQ1,
- "Sorenson Version 1",
- "From the chearch of codecs of yesterday's sights");
-- result->ffmpeg_id = CODEC_ID_SVQ1;
-+ result->ffmpeg_id = AV_CODEC_ID_SVQ1;
- }
-
- void quicktime_init_codec_svq3(quicktime_video_map_t *vtrack)
-@@ -1249,7 +1257,7 @@ void quicktime_init_codec_svq3(quicktime
- QUICKTIME_SVQ3,
- "Sorenson Version 3",
- "From the chearch of codecs of yesterday's sights");
-- result->ffmpeg_id = CODEC_ID_SVQ3;
-+ result->ffmpeg_id = AV_CODEC_ID_SVQ3;
- }
-
- void quicktime_init_codec_h263(quicktime_video_map_t *vtrack)
-@@ -1258,7 +1266,7 @@ void quicktime_init_codec_h263(quicktime
- QUICKTIME_H263,
- "H.263",
- "H.263");
-- result->ffmpeg_id = CODEC_ID_H263;
-+ result->ffmpeg_id = AV_CODEC_ID_H263;
- }
-
- void quicktime_init_codec_xvid(quicktime_video_map_t *vtrack)
-@@ -1267,7 +1275,7 @@ void quicktime_init_codec_xvid(quicktime
- QUICKTIME_XVID,
- "XVID",
- "FFmpeg MPEG-4");
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- }
-
- void quicktime_init_codec_dnxhd(quicktime_video_map_t *vtrack)
-@@ -1276,7 +1284,7 @@ void quicktime_init_codec_dnxhd(quicktim
- QUICKTIME_DNXHD,
- "DNXHD",
- "DNXHD");
-- result->ffmpeg_id = CODEC_ID_DNXHD;
-+ result->ffmpeg_id = AV_CODEC_ID_DNXHD;
- }
-
- // field based MPEG-4
-@@ -1287,7 +1295,7 @@ void quicktime_init_codec_hv60(quicktime
- "Dual MPEG-4",
- "MPEG 4 with alternating streams every other frame. (Not standardized)");
- result->total_fields = 2;
-- result->ffmpeg_id = CODEC_ID_MPEG4;
-+ result->ffmpeg_id = AV_CODEC_ID_MPEG4;
- }
-
-
-Index: cinelerra-20140710/quicktime/qtffmpeg.c
-===================================================================
---- cinelerra-20140710.orig/quicktime/qtffmpeg.c
-+++ cinelerra-20140710/quicktime/qtffmpeg.c
-@@ -39,7 +39,7 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
- ptr->height = h;
- ptr->ffmpeg_id = ffmpeg_id;
- //printf("quicktime_new_ffmpeg 1 %d\n", ptr->ffmpeg_id);
-- if(ffmpeg_id == CODEC_ID_SVQ1)
-+ if(ffmpeg_id == AV_CODEC_ID_SVQ1)
- {
- ptr->width_i = quicktime_quantize32(ptr->width);
- ptr->height_i = quicktime_quantize32(ptr->height);
-@@ -86,10 +86,10 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
- context->extradata_size = avcc->data_size;
- }
- if(cpus > 1 &&
-- (ffmpeg_id == CODEC_ID_MPEG4 ||
-- ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
-- ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
-- ffmpeg_id == CODEC_ID_H263P ))
-+ (ffmpeg_id == AV_CODEC_ID_MPEG4 ||
-+ ffmpeg_id == AV_CODEC_ID_MPEG1VIDEO ||
-+ ffmpeg_id == AV_CODEC_ID_MPEG2VIDEO ||
-+ ffmpeg_id == AV_CODEC_ID_H263P ))
- {
- context->thread_count = cpus;
- }
-@@ -224,16 +224,16 @@ static int get_chroma_factor(quicktime_f
- {
- switch(ffmpeg->decoder_context[current_field]->pix_fmt)
- {
-- case PIX_FMT_YUV420P:
-+ case AV_PIX_FMT_YUV420P:
- return 4;
- break;
-- case PIX_FMT_YUYV422:
-+ case AV_PIX_FMT_YUYV422:
- return 2;
- break;
-- case PIX_FMT_YUV422P:
-+ case AV_PIX_FMT_YUV422P:
- return 2;
- break;
-- case PIX_FMT_YUV410P:
-+ case AV_PIX_FMT_YUV410P:
- return 9;
- break;
- default:
-@@ -277,7 +277,7 @@ int quicktime_ffmpeg_decode(quicktime_ff
- //printf("quicktime_ffmpeg_decode 1 %d\n", ffmpeg->last_frame[current_field]);
-
- if(ffmpeg->last_frame[current_field] == -1 &&
-- ffmpeg->ffmpeg_id != CODEC_ID_H264)
-+ ffmpeg->ffmpeg_id != AV_CODEC_ID_H264)
- {
- int current_frame = vtrack->current_position;
- // For certain codecs,
-@@ -328,7 +328,7 @@ int quicktime_ffmpeg_decode(quicktime_ff
- // For MPEG-4, get another keyframe before first keyframe.
- // The Sanyo tends to glitch with only 1 keyframe.
- // Not enough memory.
-- if( 0 /* frame1 > 0 && ffmpeg->ffmpeg_id == CODEC_ID_MPEG4 */)
-+ if( 0 /* frame1 > 0 && ffmpeg->ffmpeg_id == AV_CODEC_ID_MPEG4 */)
- {
- do
- {
-@@ -423,16 +423,16 @@ int quicktime_ffmpeg_decode(quicktime_ff
- // Hopefully this setting will be left over if the cache was used.
- switch(ffmpeg->decoder_context[current_field]->pix_fmt)
- {
-- case PIX_FMT_YUV420P:
-+ case AV_PIX_FMT_YUV420P:
- input_cmodel = BC_YUV420P;
- break;
-- case PIX_FMT_YUYV422:
-+ case AV_PIX_FMT_YUYV422:
- input_cmodel = BC_YUV422;
- break;
-- case PIX_FMT_YUV422P:
-+ case AV_PIX_FMT_YUV422P:
- input_cmodel = BC_YUV422P;
- break;
-- case PIX_FMT_YUV410P:
-+ case AV_PIX_FMT_YUV410P:
- input_cmodel = BC_YUV9P;
- break;
- default:
-Index: cinelerra-20140710/quicktime/qth264.c
-===================================================================
---- cinelerra-20140710.orig/quicktime/qth264.c
-+++ cinelerra-20140710/quicktime/qth264.c
-@@ -370,7 +370,7 @@ static int decode(quicktime_t *file, uns
- if(!codec->decoder) codec->decoder = quicktime_new_ffmpeg(
- file->cpus,
- codec->total_fields,
-- CODEC_ID_H264,
-+ AV_CODEC_ID_H264,
- width,
- height,
- stsd_table);
-Index: cinelerra-20140710/quicktime/wma.c
-===================================================================
---- cinelerra-20140710.orig/quicktime/wma.c
-+++ cinelerra-20140710/quicktime/wma.c
-@@ -193,15 +193,38 @@ printf("decode 2 %x %llx %llx\n", chunk_
- codec->packet_buffer,
- chunk_size);
- #else
-- bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- AVPacket pkt;
- av_init_packet( &pkt );
- pkt.data = codec->packet_buffer;
- pkt.size = chunk_size;
-- result = avcodec_decode_audio3(codec->decoder_context,
-- (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
-- &bytes_decoded,
-+ AVFrame *frame = av_frame_alloc();
-+ int got_frame = 0;
-+
-+ result = avcodec_decode_audio4(codec->decoder_context,
-+ frame, &got_frame,
- &pkt);
-+
-+ if(result >= 0 && got_frame)
-+ {
-+ int ch, plane_size;
-+ int planar = av_sample_fmt_is_planar(codec->decoder_context->sample_fmt);
-+ int data_size = av_samples_get_buffer_size(&plane_size, codec->decoder_context->channels,
-+ frame->nb_samples,
-+ codec->decoder_context->sample_fmt, 1);
-+ memcpy(codec->work_buffer + codec->output_size * sample_size, frame->extended_data[0], plane_size);
-+
-+ if (planar && codec->decoder_context->channels > 1) {
-+ uint8_t *out = ((uint8_t *)(codec->work_buffer + codec->output_size * sample_size)) + plane_size;
-+ for (ch = 1; ch < codec->decoder_context->channels; ch++) {
-+ memcpy(out, frame->extended_data[ch], plane_size);
-+ out += plane_size;
-+ }
-+ }
-+ bytes_decoded = data_size;
-+ } else {
-+ bytes_decoded = 0;
-+ }
-+ av_frame_free(&frame);
- #endif
-
- pthread_mutex_unlock(&ffmpeg_lock);
-@@ -298,7 +321,7 @@ void quicktime_init_codec_wmav1(quicktim
- codec_base->title = "Win Media Audio 1";
- codec_base->desc = "Win Media Audio 1";
- codec_base->wav_id = 0x160;
-- codec->ffmpeg_id = CODEC_ID_WMAV1;
-+ codec->ffmpeg_id = AV_CODEC_ID_WMAV1;
- }
-
-
-@@ -313,5 +336,5 @@ void quicktime_init_codec_wmav2(quicktim
- codec_base->title = "Win Media Audio 2";
- codec_base->desc = "Win Media Audio 2";
- codec_base->wav_id = 0x161;
-- codec->ffmpeg_id = CODEC_ID_WMAV2;
-+ codec->ffmpeg_id = AV_CODEC_ID_WMAV2;
- }
-Index: cinelerra-20140710/cinelerra/fileyuv.C
-===================================================================
---- cinelerra-20140710.orig/cinelerra/fileyuv.C
-+++ cinelerra-20140710/cinelerra/fileyuv.C
-@@ -196,7 +196,7 @@ int FileYUV::write_frames(VFrame ***laye
- return stream->write_frame_raw(frame->get_data(), frame_size);
-
- // decode and write an encoded frame
-- if (FFMPEG::codec_id(incoming_asset->vcodec) != CODEC_ID_NONE)
-+ if (FFMPEG::codec_id(incoming_asset->vcodec) != AV_CODEC_ID_NONE)
- {
- if (! ffmpeg)
- {
-@@ -306,7 +306,7 @@ int FileYUV::can_copy_from(Edit *edit, i
- if (edit->asset->format == FILE_YUV) return 1;
-
- // if FFMPEG can decode it, we'll accept it
-- if (FFMPEG::codec_id(edit->asset->vcodec) != CODEC_ID_NONE) return 1;
-+ if (FFMPEG::codec_id(edit->asset->vcodec) != AV_CODEC_ID_NONE) return 1;
-
- incoming_asset = 0;
-
diff --git a/media-video/cinelerra/files/cinelerra-implicit_decls.patch b/media-video/cinelerra/files/cinelerra-implicit_decls.patch
deleted file mode 100644
index c806715e8c4..00000000000
--- a/media-video/cinelerra/files/cinelerra-implicit_decls.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Index: CinelerraCV-2.3/quicktime/graphics.c
-===================================================================
---- CinelerraCV-2.3.orig/quicktime/graphics.c
-+++ CinelerraCV-2.3/quicktime/graphics.c
-@@ -1,5 +1,6 @@
- #include "graphics.h"
-
-+#include <stdlib.h>
- #include <string.h>
-
- /* Graphics acceleration routines */
-Index: CinelerraCV-2.3/quicktime/libmjpeg.c
-===================================================================
---- CinelerraCV-2.3.orig/quicktime/libmjpeg.c
-+++ CinelerraCV-2.3/quicktime/libmjpeg.c
-@@ -17,6 +17,8 @@
-
- #include <stdio.h>
- #include <stdlib.h>
-+#include <string.h>
-+#include <strings.h>
- #include "colormodels.h"
- #include "libmjpeg.h"
-
-Index: CinelerraCV-2.3/quicktime/qtpng.c
-===================================================================
---- CinelerraCV-2.3.orig/quicktime/qtpng.c
-+++ CinelerraCV-2.3/quicktime/qtpng.c
-@@ -1,6 +1,7 @@
- #include "colormodels.h"
- #include "funcprotos.h"
- #include <png.h>
-+#include <string.h>
- #include "quicktime.h"
- #include "qtpng.h"
-
diff --git a/media-video/cinelerra/files/cinelerra-includes.patch b/media-video/cinelerra/files/cinelerra-includes.patch
deleted file mode 100644
index 45ac200310d..00000000000
--- a/media-video/cinelerra/files/cinelerra-includes.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: CinelerraCV-2.3/cinelerra/audiodevice.C
-===================================================================
---- CinelerraCV-2.3.orig/cinelerra/audiodevice.C
-+++ CinelerraCV-2.3/cinelerra/audiodevice.C
-@@ -19,6 +19,7 @@
- *
- */
-
-+#include <cassert>
- #ifdef HAVE_FIREWIRE
- #include "audio1394.h"
- #endif
diff --git a/media-video/cinelerra/files/cinelerra-libav9.patch b/media-video/cinelerra/files/cinelerra-libav9.patch
deleted file mode 100644
index 47a4d6f231e..00000000000
--- a/media-video/cinelerra/files/cinelerra-libav9.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-diff -urN cinelerra-20120707/cinelerra/ffmpeg.C /tmp/cinelerra-20120707/cinelerra/ffmpeg.C
---- cinelerra-20120707/cinelerra/ffmpeg.C 2013-06-22 18:07:43.632978553 +0200
-+++ /tmp/cinelerra-20120707/cinelerra/ffmpeg.C 2013-06-22 18:07:21.668979334 +0200
-@@ -32,9 +32,9 @@
- return 1;
- }
-
-- context = avcodec_alloc_context();
-+ context = avcodec_alloc_context3(NULL);
-
-- if (avcodec_open(context, codec)) {
-+ if (avcodec_open2(context, codec, NULL)) {
- printf("FFMPEG::init avcodec_open() failed\n");
- }
-
-diff -urN cinelerra-20120707/cinelerra/fileac3.C /tmp/cinelerra-20120707/cinelerra/fileac3.C
---- cinelerra-20120707/cinelerra/fileac3.C 2013-06-22 18:07:43.632978553 +0200
-+++ /tmp/cinelerra-20120707/cinelerra/fileac3.C 2013-06-22 18:07:21.668979334 +0200
-@@ -91,11 +91,11 @@
- eprintf("codec not found.\n");
- return 1;
- }
-- codec_context = avcodec_alloc_context();
-+ codec_context = avcodec_alloc_context3(NULL);
- codec_context->bit_rate = asset->ac3_bitrate * 1000;
- codec_context->sample_rate = asset->sample_rate;
- codec_context->channels = asset->channels;
-- if(avcodec_open(codec_context, codec))
-+ if(avcodec_open2(codec_context, codec, NULL))
- {
- eprintf("failed to open codec.\n");
- return 1;
-diff -urN cinelerra-20120707/quicktime/mpeg4.c /tmp/cinelerra-20120707/quicktime/mpeg4.c
---- cinelerra-20120707/quicktime/mpeg4.c 2013-06-22 18:07:43.633978553 +0200
-+++ /tmp/cinelerra-20120707/quicktime/mpeg4.c 2013-06-22 18:07:21.690979334 +0200
-@@ -642,7 +642,7 @@
- return 1;
- }
-
-- codec->encoder_context[current_field] = avcodec_alloc_context();
-+ codec->encoder_context[current_field] = avcodec_alloc_context3(NULL);
- AVCodecContext *context = codec->encoder_context[current_field];
-
- context->width = width_i;
-@@ -676,8 +676,6 @@
- context->error_resilience = FF_ER_CAREFUL;
- #elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
- context->error_recognition = FF_ER_CAREFUL;
--#else
-- context->err_recognition |= AV_EF_CAREFUL;
- #endif
- context->error_concealment = 3;
- context->frame_skip_cmp = FF_CMP_DCTMAX;
-diff -urN cinelerra-20120707/quicktime/qtffmpeg.c /tmp/cinelerra-20120707/quicktime/qtffmpeg.c
---- cinelerra-20120707/quicktime/qtffmpeg.c 2013-06-22 18:07:43.633978553 +0200
-+++ /tmp/cinelerra-20120707/quicktime/qtffmpeg.c 2013-06-22 18:07:21.690979334 +0200
-@@ -67,7 +67,7 @@
- return 0;
- }
-
-- AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context();
-+ AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context3(NULL);
- static char fake_data[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- context->width = ptr->width_i;
- context->height = ptr->height_i;
-@@ -93,8 +93,8 @@
- {
- context->thread_count = cpus;
- }
-- if(avcodec_open(context,
-- ptr->decoder[i]) < 0)
-+ if(avcodec_open2(context,
-+ ptr->decoder[i], NULL) < 0)
- {
- printf("quicktime_new_ffmpeg: avcodec_open failed.\n");
- quicktime_delete_ffmpeg(ptr);
-diff -urN cinelerra-20120707/quicktime/wma.c /tmp/cinelerra-20120707/quicktime/wma.c
---- cinelerra-20120707/quicktime/wma.c 2013-06-22 18:07:43.634978553 +0200
-+++ /tmp/cinelerra-20120707/quicktime/wma.c 2013-06-22 18:07:21.690979334 +0200
-@@ -76,10 +76,10 @@
- printf("init_decode: avcodec_find_decoder returned NULL.\n");
- return 1;
- }
-- codec->decoder_context = avcodec_alloc_context();
-+ codec->decoder_context = avcodec_alloc_context3(NULL);
- codec->decoder_context->sample_rate = trak->mdia.minf.stbl.stsd.table[0].sample_rate;
- codec->decoder_context->channels = track_map->channels;
-- if(avcodec_open(codec->decoder_context, codec->decoder) < 0)
-+ if(avcodec_open2(codec->decoder_context, codec->decoder, NULL) < 0)
- {
- printf("init_decode: avcodec_open failed.\n");
- return 1;
-
diff --git a/media-video/cinelerra/files/cinelerra-pngtoh.patch b/media-video/cinelerra/files/cinelerra-pngtoh.patch
deleted file mode 100644
index 81a8432b872..00000000000
--- a/media-video/cinelerra/files/cinelerra-pngtoh.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=526118
-http://bugs.cinelerra-cv.org/ticket/1005
-
-Author: Bernd Feige
-
---- guicast/pngtoh.c 2015-01-29 13:41:01 +0000
-+++ guicast/pngtoh.c 2015-01-29 13:41:07 +0000
-@@ -148,4 +148,6 @@
- fprintf(out, "};\n\n#endif\n");
- fclose(out);
- }
-+
-+ return 0;
- }
-
diff --git a/media-video/cinelerra/files/cinelerra-putbits-gcc52.patch b/media-video/cinelerra/files/cinelerra-putbits-gcc52.patch
deleted file mode 100644
index 646db9f25f0..00000000000
--- a/media-video/cinelerra/files/cinelerra-putbits-gcc52.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=562208
-
-Index: cinelerra-20140710/toolame-02l/bitstream.c
-===================================================================
---- cinelerra-20140710.orig/toolame-02l/bitstream.c
-+++ cinelerra-20140710/toolame-02l/bitstream.c
-@@ -198,9 +198,6 @@ void put1bit (Bit_stream_struc * bs, int
- }
-
- /*write N bits into the bit stream */
--#if !defined(__clang__)
--INLINE
--#endif /* not __clang__ */
- void putbits (Bit_stream_struc * bs, unsigned int val, int N)
- {
- register int j = N;
-Index: cinelerra-20140710/toolame-02l/bitstream.h
-===================================================================
---- cinelerra-20140710.orig/toolame-02l/bitstream.h
-+++ cinelerra-20140710/toolame-02l/bitstream.h
-@@ -9,7 +9,7 @@ unsigned int get1bit (Bit_stream_struc *
- void put1bit (Bit_stream_struc *, int);
- unsigned long look_ahead (Bit_stream_struc *, int);
- unsigned long getbits (Bit_stream_struc *, int);
--INLINE void putbits (Bit_stream_struc *, unsigned int, int);
-+void putbits (Bit_stream_struc *, unsigned int, int);
- void byte_ali_putbits (Bit_stream_struc *, unsigned int, int);
- unsigned long byte_ali_getbits (Bit_stream_struc *, int);
- unsigned long sstell (Bit_stream_struc *);