1 https://bugs.gentoo.org/show_bug.cgi?id=479394
4 --- cinelerra/ffmpeg.h.ORIG 2012-07-06 22:40:26.000000000 +0200
5 +++ cinelerra/ffmpeg.h 2013-08-01 12:58:12.342474136 +0200
7 static int convert_cmodel_transfer(VFrame *frame_in,VFrame *frame_out);
8 static int init_picture_from_frame(AVPicture *picture, VFrame *frame);
10 - static CodecID codec_id(char *codec_string);
11 + static AVCodecID codec_id(char *codec_string);
14 static PixelFormat color_model_to_pix_fmt(int color_model);
15 --- cinelerra/ffmpeg.C.ORIG 2013-08-01 11:24:43.794419246 +0200
16 +++ cinelerra/ffmpeg.C 2013-08-01 12:57:48.121473899 +0200
19 avcodec_register_all();
21 - CodecID id = codec_id(codec_string);
22 + AVCodecID id = codec_id(codec_string);
23 codec = avcodec_find_decoder(id);
25 printf("FFMPEG::init no decoder for '%s'", codec_string);
26 @@ -33,9 +33,9 @@ int FFMPEG::init(char *codec_string) {
30 - context = avcodec_alloc_context();
31 + context = avcodec_alloc_context3(codec);
33 - if (avcodec_open(context, codec)) {
34 + if (avcodec_open2(context, codec,NULL)) {
35 printf("FFMPEG::init avcodec_open() failed\n");
42 -CodecID FFMPEG::codec_id(char *codec_string) {
43 +AVCodecID FFMPEG::codec_id(char *codec_string) {
44 #define CODEC_IS(x) (! strncmp(codec_string, x, 4))
46 if (CODEC_IS(QUICKTIME_DV) ||
47 --- cinelerra/fileac3.C
48 +++ cinelerra/fileac3.C
49 @@ -92,11 +92,11 @@ int FileAC3::open_file(int rd, int wr)
50 eprintf("codec not found.\n");
53 - codec_context = avcodec_alloc_context();
54 + codec_context = avcodec_alloc_context3(codec);
55 codec_context->bit_rate = asset->ac3_bitrate * 1000;
56 codec_context->sample_rate = asset->sample_rate;
57 codec_context->channels = asset->channels;
58 - if(avcodec_open(codec_context, codec))
59 + if(avcodec_open2(codec_context, codec,NULL))
61 eprintf("failed to open codec.\n");
65 @@ -641,7 +641,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
69 - codec->encoder_context[current_field] = avcodec_alloc_context();
70 + codec->encoder_context[current_field] = avcodec_alloc_context3(codec->encoder[current_field]);
71 AVCodecContext *context = codec->encoder_context[current_field];
73 context->width = width_i;
74 @@ -740,7 +740,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
78 - avcodec_open(context, codec->encoder[current_field]);
79 + avcodec_open2(context, codec->encoder[current_field],NULL);
81 avcodec_get_frame_defaults(&codec->picture[current_field]);
83 --- quicktime/qtffmpeg.c
84 +++ quicktime/qtffmpeg.c
85 @@ -68,7 +68,9 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus,
89 - AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context();
90 + //AVCodecContext *context = ptr->decoder_context[i] = avcodec_alloc_context();
91 + AVCodecContext *context = avcodec_alloc_context3(ptr->decoder[i]);
92 + ptr->decoder_context[i] = context;
93 static char fake_data[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
94 context->width = ptr->width_i;
95 context->height = ptr->height_i;
96 @@ -96,8 +98,7 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus,
97 avcodec_thread_init(context, cpus);
98 context->thread_count = cpus;
100 - if(avcodec_open(context,
101 - ptr->decoder[i]) < 0)
102 + if(avcodec_open2(context, ptr->decoder[i], NULL) < 0)
104 printf("quicktime_new_ffmpeg: avcodec_open failed.\n");
105 quicktime_delete_ffmpeg(ptr);
106 --- quicktime/ffmpeg/ffmpeg.c.ORIG 2012-07-06 22:40:26.000000000 +0200
107 +++ quicktime/ffmpeg/ffmpeg.c 2013-08-01 12:57:59.025474005 +0200
108 @@ -2663,7 +2663,7 @@
112 -static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
113 +static enum AVCodecID find_codec_or_die(const char *name, int type, int encoder)
115 const char *codec_string = encoder ? "encoder" : "decoder";
117 --- quicktime/ffmpeg/libavformat/electronicarts.c.ORIG 2012-07-06 22:40:26.000000000 +0200
118 +++ quicktime/ffmpeg/libavformat/electronicarts.c 2013-08-01 13:00:57.855475755 +0200
120 typedef struct EaDemuxContext {
123 - enum CodecID video_codec;
124 + enum AVCodecID video_codec;
125 AVRational time_base;
126 int video_stream_index;
128 - enum CodecID audio_codec;
129 + enum AVCodecID audio_codec;
130 int audio_stream_index;
131 int audio_frame_counter;
133 --- quicktime/ffmpeg/libavformat/img2.c.ORIG 2012-07-06 22:40:26.000000000 +0200
134 +++ quicktime/ffmpeg/libavformat/img2.c 2013-08-01 12:59:21.408474812 +0200
148 -static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
149 +static enum AVCodecID av_str2id(const IdStrMap *tags, const char *str)
151 str= strrchr(str, '.');
152 if(!str) return CODEC_ID_NONE;
157 -enum CodecID av_guess_image2_codec(const char *filename){
158 +enum AVCodecID av_guess_image2_codec(const char *filename){
159 return av_str2id(img_tags, filename);
162 --- quicktime/ffmpeg/libavformat/matroskadec.c.ORIG 2012-07-06 22:40:26.000000000 +0200
163 +++ quicktime/ffmpeg/libavformat/matroskadec.c 2013-08-01 12:59:57.556475165 +0200
164 @@ -2476,7 +2476,7 @@
167 for (i = 0; i < matroska->num_tracks; i++) {
168 - enum CodecID codec_id = CODEC_ID_NONE;
169 + enum AVCodecID codec_id = CODEC_ID_NONE;
170 uint8_t *extradata = NULL;
171 int extradata_size = 0;
172 int extradata_offset = 0;
173 @@ -2495,7 +2495,7 @@
177 - /* Set the FourCC from the CodecID. */
178 + /* Set the FourCC from the AVCodecID. */
179 /* This is the MS compatibility mode which stores a
180 * BITMAPINFOHEADER in the CodecPrivate. */
181 if (!strcmp(track->codec_id,
182 @@ -2600,7 +2600,7 @@
184 if (codec_id == CODEC_ID_NONE) {
185 av_log(matroska->ctx, AV_LOG_INFO,
186 - "Unknown/unsupported CodecID %s.\n",
187 + "Unknown/unsupported AVCodecID %s.\n",
191 --- quicktime/ffmpeg/libavformat/matroska.h.ORIG 2012-07-06 22:40:26.000000000 +0200
192 +++ quicktime/ffmpeg/libavformat/matroska.h 2013-08-01 13:00:22.218475407 +0200
193 @@ -220,12 +220,12 @@
195 typedef struct CodecTags{
201 typedef struct CodecMime{
207 #define MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC "V_MS/VFW/FOURCC"
208 --- quicktime/ffmpeg/libavformat/mov.c.ORIG 2012-07-06 22:40:26.000000000 +0200
209 +++ quicktime/ffmpeg/libavformat/mov.c 2013-08-01 12:59:33.935474934 +0200
212 for(pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) {
213 //Parsing Sample description table
217 MOV_atom_t a = { 0, 0, 0 };
218 offset_t start_pos = url_ftell(pb);
219 --- quicktime/ffmpeg/libavformat/mxf.c.ORIG 2012-07-06 22:40:26.000000000 +0200
220 +++ quicktime/ffmpeg/libavformat/mxf.c 2013-08-01 12:59:12.025474720 +0200
224 unsigned matching_len;
230 --- quicktime/ffmpeg/libavformat/riff.h.ORIG 2012-07-06 22:40:26.000000000 +0200
231 +++ quicktime/ffmpeg/libavformat/riff.h 2013-08-01 12:59:45.950475052 +0200
233 extern const AVCodecTag codec_wav_tags[];
235 unsigned int codec_get_tag(const AVCodecTag *tags, int id);
236 -enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
237 +enum AVCodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
238 void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
240 #endif /* FFMPEG_RIFF_H */
241 --- quicktime/ffmpeg/libavformat/rtp.c.ORIG 2012-07-06 22:40:26.000000000 +0200
242 +++ quicktime/ffmpeg/libavformat/rtp.c 2013-08-01 12:59:01.778474619 +0200
245 const char enc_name[6];
246 enum CodecType codec_type;
247 - enum CodecID codec_id;
248 + enum AVCodecID codec_id;
251 } AVRtpPayloadTypes[]=
256 -enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
257 +enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type)
261 --- quicktime/ffmpeg/libavformat/rtp_internal.h.ORIG 2012-07-06 22:40:26.000000000 +0200
262 +++ quicktime/ffmpeg/libavformat/rtp_internal.h 2013-08-01 13:00:09.147475279 +0200
264 // fields from AVRtpDynamicPayloadType_s
265 const char enc_name[50]; /* XXX: still why 50 ? ;-) */
266 enum CodecType codec_type;
267 - enum CodecID codec_id;
268 + enum AVCodecID codec_id;
271 int (*parse_sdp_a_line) (AVStream * stream,
274 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
275 const char *ff_rtp_enc_name(int payload_type);
276 -enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
277 +enum AVCodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
279 void av_register_rtp_dynamic_payload_handlers(void);
283 @@ -77,10 +77,10 @@ static int init_decode(quicktime_audio_map_t *track_map,
284 printf("init_decode: avcodec_find_decoder returned NULL.\n");
287 - codec->decoder_context = avcodec_alloc_context();
288 + codec->decoder_context = avcodec_alloc_context3(codec->decoder);
289 codec->decoder_context->sample_rate = trak->mdia.minf.stbl.stsd.table[0].sample_rate;
290 codec->decoder_context->channels = track_map->channels;
291 - if(avcodec_open(codec->decoder_context, codec->decoder) < 0)
292 + if(avcodec_open2(codec->decoder_context, codec->decoder,NULL) < 0)
294 printf("init_decode: avcodec_open failed.\n");
296 --- quicktime/wma.h.ORIG 2012-07-06 22:40:26.000000000 +0200
297 +++ quicktime/wma.h 2013-08-01 13:11:46.431482103 +0200
300 extern void quicktime_init_codec_wmav1(quicktime_audio_map_t *);
301 extern void quicktime_init_codec_wmav2(quicktime_audio_map_t *);
302 +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000