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); @@ -33,9 +33,9 @@ int FFMPEG::init(char *codec_string) { return 1; } - context = avcodec_alloc_context(); + context = avcodec_alloc_context3(codec); - if (avcodec_open(context, codec)) { + if (avcodec_open2(context, codec,NULL)) { printf("FFMPEG::init avcodec_open() failed\n"); } @@ -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) || --- cinelerra/fileac3.C +++ cinelerra/fileac3.C @@ -92,11 +92,11 @@ int FileAC3::open_file(int rd, int wr) eprintf("codec not found.\n"); return 1; } - codec_context = avcodec_alloc_context(); + codec_context = avcodec_alloc_context3(codec); 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; --- quicktime/mpeg4.c +++ quicktime/mpeg4.c @@ -641,7 +641,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) return 1; } - codec->encoder_context[current_field] = avcodec_alloc_context(); + codec->encoder_context[current_field] = avcodec_alloc_context3(codec->encoder[current_field]); AVCodecContext *context = codec->encoder_context[current_field]; context->width = width_i; @@ -740,7 +740,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track) * codec->fix_bitrate, * codec->quantizer); */ - avcodec_open(context, codec->encoder[current_field]); + avcodec_open2(context, codec->encoder[current_field],NULL); avcodec_get_frame_defaults(&codec->picture[current_field]); --- quicktime/qtffmpeg.c +++ quicktime/qtffmpeg.c @@ -68,7 +68,9 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, return 0; } - AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context(); + //AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context(); + AVCodecContext *context = avcodec_alloc_context3(ptr->decoder[i]); + ptr->decoder_context[i] = context; static char fake_data[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; context->width = ptr->width_i; context->height = ptr->height_i; @@ -96,8 +98,7 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus, avcodec_thread_init(context, cpus); 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); --- 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_iddecoder_context = avcodec_alloc_context(); + codec->decoder_context = avcodec_alloc_context3(codec->decoder); 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; --- 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