1 diff --git a/cinelerra/ffmpeg.C b/cinelerra/ffmpeg.C
2 index 6ab6047..7cde503 100644
3 --- a/cinelerra/ffmpeg.C
4 +++ b/cinelerra/ffmpeg.C
5 @@ -23,7 +23,6 @@ FFMPEG::FFMPEG(Asset *asset) {
7 int FFMPEG::init(char *codec_string) {
10 avcodec_register_all();
12 CodecID id = codec_id(codec_string);
13 @@ -364,12 +363,15 @@ int FFMPEG::decode(uint8_t *data, long data_size, VFrame *frame_out) {
15 // NOTE: frame must already have data space allocated
19 - int length = avcodec_decode_video(context,
20 + av_init_packet( &pkt );
22 + pkt.size = data_size;
23 + int length = avcodec_decode_video2(context,
31 printf("FFMPEG::decode error decoding frame\n");
32 diff --git a/cinelerra/fileac3.C b/cinelerra/fileac3.C
33 index a1ef61e..e56705f 100644
34 --- a/cinelerra/fileac3.C
35 +++ b/cinelerra/fileac3.C
36 @@ -84,7 +84,6 @@ int FileAC3::open_file(int rd, int wr)
41 avcodec_register_all();
42 codec = avcodec_find_encoder(CODEC_ID_AC3);
44 diff --git a/quicktime/mpeg4.c b/quicktime/mpeg4.c
45 index 81cb72b..67bcab8 100644
46 --- a/quicktime/mpeg4.c
47 +++ b/quicktime/mpeg4.c
48 @@ -629,7 +629,6 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
49 if(!ffmpeg_initialized)
51 ffmpeg_initialized = 1;
53 avcodec_register_all();
56 @@ -674,7 +673,7 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
57 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
58 context->error_resilience = FF_ER_CAREFUL;
60 - context->error_recognition = FF_ER_CAREFUL;
61 + context->err_recognition = AV_EF_CRCCHECK;
63 context->error_concealment = 3;
64 context->frame_skip_cmp = FF_CMP_DCTMAX;
65 @@ -699,7 +698,6 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
66 context->profile= FF_PROFILE_UNKNOWN;
67 context->rc_buffer_aggressivity = 1.0;
68 context->level= FF_LEVEL_UNKNOWN;
69 - context->flags |= CODEC_FLAG_H263P_UMV;
70 context->flags |= CODEC_FLAG_AC_PRED;
72 // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
73 @@ -717,10 +715,8 @@ static int encode(quicktime_t *file, unsigned char **row_pointers, int track)
74 (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
75 codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
76 codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
77 - codec->ffmpeg_id == CODEC_ID_H263P ||
78 - codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
79 + codec->ffmpeg_id == CODEC_ID_H263P))
81 - avcodec_thread_init(context, file->cpus);
82 context->thread_count = file->cpus;
85 diff --git a/quicktime/qtffmpeg.c b/quicktime/qtffmpeg.c
86 index 8c532c2..a2b51e9 100644
87 --- a/quicktime/qtffmpeg.c
88 +++ b/quicktime/qtffmpeg.c
89 @@ -54,7 +54,6 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus,
90 if(!ffmpeg_initialized)
92 ffmpeg_initialized = 1;
94 avcodec_register_all();
97 @@ -90,10 +89,8 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg(int cpus,
98 (ffmpeg_id == CODEC_ID_MPEG4 ||
99 ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
100 ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
101 - ffmpeg_id == CODEC_ID_H263P ||
102 - ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
103 + ffmpeg_id == CODEC_ID_H263P))
105 - avcodec_thread_init(context, cpus);
106 context->thread_count = cpus;
108 if(avcodec_open(context,
109 @@ -181,6 +178,7 @@ static int decode_wrapper(quicktime_t *file,
116 // No way to determine if there was an error based on nonzero status.
117 @@ -189,11 +187,13 @@ static int decode_wrapper(quicktime_t *file,
118 ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_NONREF /* AVDISCARD_BIDIR */;
120 ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_DEFAULT;
121 - result = avcodec_decode_video(ffmpeg->decoder_context[current_field],
122 + av_init_packet( &pkt );
123 + pkt.data = ffmpeg->work_buffer;
124 + pkt.size = bytes + header_bytes;
125 + result = avcodec_decode_video2(ffmpeg->decoder_context[current_field],
126 &ffmpeg->picture[current_field],
128 - ffmpeg->work_buffer,
129 - bytes + header_bytes);
134 diff --git a/quicktime/wma.c b/quicktime/wma.c
135 index c045741..abc2dc8 100644
136 --- a/quicktime/wma.c
137 +++ b/quicktime/wma.c
138 @@ -67,7 +67,6 @@ static int init_decode(quicktime_audio_map_t *track_map,
139 if(!ffmpeg_initialized)
141 ffmpeg_initialized = 1;
143 avcodec_register_all();
146 @@ -195,11 +194,14 @@ printf("decode 2 %x %llx %llx\n", chunk_size, chunk_offset, chunk_offset + chunk
149 bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
150 - result = avcodec_decode_audio2(codec->decoder_context,
152 + av_init_packet( &pkt );
153 + pkt.data = codec->packet_buffer;
154 + pkt.size = chunk_size;
155 + result = avcodec_decode_audio3(codec->decoder_context,
156 (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
158 - codec->packet_buffer,
163 pthread_mutex_unlock(&ffmpeg_lock);